Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 29-12-2020, 01:07
Cuttlas's Avatar
Cuttlas Cuttlas is offline
Registered User
 
Join Date: Aug 2020
Location: Near You :)
Posts: 62
Thanks: 19
Thanked 10 Times in 5 Posts
Cuttlas is on a distinguished road
Cool WindowLong Problems On Setup Exit

Hi
I use several plugins and modules within my setup, such as WinTB, botva2, progressBar, Trackbar.
They will use SetWindowLong and I should release them in the correct situation. But sometimes I do not know where to release and so on ... So the setup will delay on Exit and will close with an error in the debugger (most with 0xc000041d exit code).

How to trace the problem and release the WindowLong? any idea or similar Experience?
Reply With Quote
Sponsored Links
  #2  
Old 29-12-2020, 03:47
Ele's Avatar
Ele Ele is offline
Registered User
 
Join Date: Nov 2020
Location: Near Mars
Posts: 93
Thanks: 89
Thanked 96 Times in 37 Posts
Ele is on a distinguished road
Quote:
Originally Posted by Cuttlas View Post
Hi
I use several plugins and modules within my setup, such as WinTB, botva2, progressBar, Trackbar.
They will use SetWindowLong and I should release them in the correct situation. But sometimes I do not know where to release and so on ... So the setup will delay on Exit and will close with an error in the debugger (most with 0xc000041d exit code).

How to trace the problem and release the WindowLong? any idea or similar Experience?
Some plugins require a proper exit like gdipShutdown for botva2, ISDoneStop for ISDone, etc. Otherwise it returns exit errors.

Example: (botva2)
Code:
procedure DeInitializeSetup;
begin
    gdipShutdown;
end;
Reply With Quote
The Following User Says Thank You to Ele For This Useful Post:
Cuttlas (30-12-2020)
  #3  
Old 30-12-2020, 12:12
Cuttlas's Avatar
Cuttlas Cuttlas is offline
Registered User
 
Join Date: Aug 2020
Location: Near You :)
Posts: 62
Thanks: 19
Thanked 10 Times in 5 Posts
Cuttlas is on a distinguished road
I also used WizardForm.Free. It seems it solved the probelm
Reply With Quote
  #4  
Old 30-12-2020, 18:08
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,073
Thanks: 1,814
Thanked 2,302 Times in 786 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by Cuttlas View Post
Hi
I use several plugins and modules within my setup, such as WinTB, botva2, progressBar, Trackbar.
They will use SetWindowLong and I should release them in the correct situation. But sometimes I do not know where to release and so on ... So the setup will delay on Exit and will close with an error in the debugger (most with 0xc000041d exit code).

How to trace the problem and release the WindowLong? any idea or similar Experience?
If you loaded any PROC with SetWindowlong it is necessary to restore the previous values.
Example:
Code:
const
  GWL_WNDPROC = (-4);
  SC_MINIMIZE = $F020;
  WM_SYSCOMMAND = $0112;

var
  OldProc: Longint;

function CallWindowProc(lpPrevWndFunc: Longint; hWnd: HWND; Msg: UINT; wParam, lParam: Longint): Longint; external '[email protected] stdcall delayload';
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external '[email protected] stdcall delayload';

function WindowProc(hWnd: HWND; uMsg, wParam, lParam: Longint): Longint;
begin
  //code here
  Result := CallWindowProc(OldProc, hWnd, uMsg, wParam, lParam);
end;

procedure InitializeWizard();
begin
  OldProc := SetWindowLong(WizardForm.Handle, GWL_WNDPROC, CreateCallBack(@WindowProc));
end;

procedure DeinitializeSetup();
begin
  SetWindowLong(WizardForm.Handle, GWL_WNDPROC, OldProc);
end;
If you use Timers calling SetTimer they must also be terminated with KillTimer.
Reply With Quote
The Following 2 Users Say Thank You to Cesar82 For This Useful Post:
Cuttlas (30-12-2020), ffmla (30-12-2020)
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Useful Dll for Inno Setup users peterf1999 Conversion Tutorials 88 01-12-2017 16:00
Have Problems With Burning Please Help!!!!!!!!!!!!!!!! dblue CD/DVD Software & Utilities 1 15-09-2004 17:08
Problems with chipped PS2 Online!!! Help/comments welcome Stevey1976 PS2 Games 5 23-06-2003 12:21
PS2 With Neo4, some Teething Problems, anyone help ? UPDATE 2 ! GAZUK23 PS2 Games 1 30-11-2001 11:16
PS2 With Neo4, some Teething Problems, anyone help ? GAZUK23 PS2 Games 1 30-11-2001 04:01



All times are GMT -7. The time now is 23:59.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com