Followings are the useful example can run shell command./* Programmed 1998 by Kurapa Chunun Kang (kurapa@kurapa.com) By below function, you can run shell command easily.*/#include void KShellExecute(HWND handle, LPCTST...
To capture the output of the PowerShell command and store it in a string variable, you can modify the RunPowerShellCommandAsAdmin procedure to redirect the output of the PowerShell process and read it into a string. In this modified code:We create a T...
In Delphi, you can execute commands with administrator privileges by using the ShellExecute function with the 'runas' verb. However, if you want to execute a specific command with administrator privileges, you can use the CreateProcess function from the Wi...
Below is the example of running command with hidden mode. Actually there lots of command type in Windows like SW_NORMAL, SW_HIDE, ...What I am going to implement is running windows command with hidden mode.Below is the example of windows command execution ...
KMP String Matching Algorithm is well-known algorithm for faster string search. KMP is, as you know, Knuth, Morris, and Pratt. It's complexity is O(n). n is the length of target string and O is big-O notation.Here's the implemented algorithm.//////////////...
You can launch application on windows by ShellExecute function. Following is the simple example to launch application.use ShellAPI;...ShellExecute(Handle, 'open', PChar('c: estapp.exe'), nil, nil, SW_SHOW);In case of running DOS command application such as...
Without complex programming, you can print document by ShellExecute function.use ShellAPI;...ShellExecute(Handle, 'print', PChar('c: est est.doc'), nil, nil, SW_SHOW);
Here's the good example for URL Encoding & Decoding. Above sample code use CString, so if you want to use it on another type of development environment such as gcc or something like that, you need to add some more stuffs because it may not suppo...
I tried to load HTML resource that stored in the application for MFC based application programming. The resource name is IDR_KURAPA_COM_HTML_ROOT.Actually this is very convenient to reduce files for application package.You can load HTML resource as followi...
Hi, problem with MFC Dialog based app: In OnInitDialog: Code: SetTimer( WM_USER+100, 500, NULL ); In OnTimer: Code: MessageBox(... CDialog::OnTimer(nIDEvent); But OnTimer never reached. Why? When i call SendMessage( WM_TIMER, 0, 0); OnTimer calls succesful...
In case of finding files on certain directory, you need to use FindFirstFileEx function.Following example shows the example,bool KFindFile(void *findname){ WIN32_FIND_DATA FindFileData; HANDLE hFind; CString strSearch...
If you need to install an "inf" file using Delphi, you could use the next code: { Usage: InstallINF('C:XYZ.inf', 0) ; } uses ShellAPI; function InstallINF(const PathName: string; hParent: HWND): Boolean; var instance: HINST; begin &nbs...
Here's the code that will display the standard Windows Properties dialog for a specified file (object) name.Usage:ShowProperties(Application.Handle, 'c:autoexec.bat')Here's the function source.function ShowProperties(hWndOwner: HWND; const FileName: string...
Below is the double linked list example that based on console.Specially this application use macro by define function provided by ANSI C.It's just like inline function that C++ provides.
The below attachment is HTTP Server source code that supports CGI. Detail Description: HTTPSVR is an MFC sample that demonstrates the use of MFC and its Windows Sockets (WinSock) classes in implementing a simple World Wide Web HTTP server. HTTPSVR turns an...
Followings are the procedure to send/receive UDP packet by CAsyncSocket.STEP 1. ConstructionConstruct a CAsyncSocket object and use the object to create the underlying SOCKET handle.Creation of a socket follows the MFC pattern of two-stage construction.For...
The following is sample code showing use of CAsyncSocket to send and receive UDP packets. I used the ClassWizard to create a class (CUDPSocket) derived from CAsyncSocket. The derived class does little more than override OnReceive. The derived class is used...
Recently I needed to determine when removable media, such as a zip disk or media card, had been inserted by the user. I initially looked into the WM_DEVICECHANGE broadcast message only to realise this supports CDROMs and little else. Fortunately there is a...
In this short snippet, I will show you a Win32 function that checks whether a button is pressed or not. The good thing is that you don't need to handle the WM_KEYDOWN message. The second advantage is that it is really easy to use and that it can be used ev...
In this short howto I will explain how to setup your apache webserver to run any compiled application as an CGI script and show a little example program to explain the main concepts. So why does someone might have the idea to execute an application? There ...
Use this function to open your browser with a given URL.uses shellapi; .... procedure TForm1.Label1Click(Sender:TObject); begin shellexecute(handle,'open','http://www.swissdelphicenter.ch', nil,nil,sw_show); ...