CodePudding user response:
The building Lord, I think you do this is completely unnecessary, if your application must run on SQL Server, you just need to let the users themselves to installed, when you start to judge their own database connection is valid, you big effort needed to fix the problem so what is the point? Do you want to run the program all the things are related to the environment for the user to do?CodePudding user response:
1, the run,,,,2, check whether the installation process, such as there are already installed,
3, the Yield (), double checking the existence of the installation process and if there is no end
CodePudding user response:
But how to get the process? I use the following methods:Ll_l=GetModuleHandleA (" SETUPSQL ")
Messagebox (string (ll_l), "")
Get the news of the value is 0
Long ll_l
Ll_l=GetModuleHandleA (" SETUPSQL ")
Messagebox (string (ll_l), "")
Do
The Yield ()
Loop until GetModuleHandleA (" SETUPSQL ")=0
Still doesn't work.
CodePudding user response:
But how to get the process? I use the following methods:The run (ls_sqlpath)//ls_sqlpath is essentially a no one place to install command path
Ll_l=GetModuleHandleA (" SETUPSQL ")
Messagebox (string (ll_l), "")
Get the news of the value is 0
Long ll_l
Ll_l=GetModuleHandleA (" SETUPSQL ")
Messagebox (string (ll_l), "")
Do
The Yield ()
Loop until GetModuleHandleA (" SETUPSQL ")=0
Still doesn't work.
CodePudding user response:
Urgent need, please adviseCodePudding user response:
In circulation, the decision process. If you have installed the process, just wait, and then judge again.Judgment process is generally more accurate than determine window,
Can use CreateToolhelp32Snapshot, several functions such as Process32Next judgement!
CodePudding user response:
With the example of several functions? Or use? thank youCodePudding user response:
//testing processPROCESSENTRY32 Process
Long ll_ProcSnap, ll_mainid
String ls_proname, ls_main
The Integer li_result, li_Return
Ll_ProcSnap=CreateToolhelp32Snapshot (TH32CS_SNAPPROCESS, 0)
//system process failure, direct return
If ll_procSnap & lt;=0 Then Return 0
Process. The dwsize=1060//usually use
Process32First (ll_ProcSnap, Process)
If Not ab_main Then
Do Until Process32Next (ll_ProcSnap, Process) & lt; 1//iterate through all the process until the return value to False
Ls_proname=Left (process. Szexefile, Len (process. Szexefile) - (4)
If This of_question (ls_proname, Process. Th32processid) & lt;> 0 Then Return 1
Loop
The Else
Do Until Process32Next (ll_ProcSnap, Process) & lt; 1//iterate through all the process until the return value to False
Ls_proname=Left (process. Szexefile, Len (process. Szexefile) - (4)
If the lower (ls_proname)="newstart" Then ll_mainid=Process. Th32processid
Li_result=This. Of_question (ls_proname, Process th32processid, True)
Li_Return=li_Return + li_result
Loop
CodePudding user response:
Pick up points first!