Advertisement
Guest User

Untitled

a guest
Aug 10th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.64 KB | None | 0 0
  1.   Semaphor := CreateSemaphore(nil, 0, 1, '_EEG32_');
  2.   if ((Semaphor <> 0) and (GetLastError = ERROR_ALREADY_EXISTS)) then
  3.   begin
  4.     Wnd := FindWindow(PChar('Deymed_EEGACq'), nil);
  5.  
  6.     if Wnd = 0 then
  7.     begin
  8.       Wnd := FindWindow(PChar('TServerForm'), nil);
  9.       if Wnd <> 0 then
  10.         TBoxes.Error('Cannot start TruScan Acquisition while TruScan UDP Server is running.');
  11.     end;
  12.  
  13.     if (Wnd <> 0) then
  14.     begin
  15.       Popup := GetWindowLong(Wnd, GWL_HWNDPARENT);
  16.       if IsIconic(Popup) then
  17.         ShowWindow(Popup, SW_RESTORE);
  18.  
  19.       SetForegroundwindow(Popup);
  20.     end;
  21.  
  22.     CloseHandle(Semaphor);
  23.     Halt;
  24.   end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement