Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


CreateDialog

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
WafflesFTW
Expert Cheater
Reputation: 0

Joined: 21 Mar 2008
Posts: 131

PostPosted: Tue Jun 24, 2008 7:28 am    Post subject: CreateDialog Reply with quote

How do I close the damn dialog? The cursor won't even hover over the red x, and I can't exit it w/o rightclicking item on bar and click close.
HELP!!


Code:
#include <windows.h>
#include <resource.h>

LRESULT WINAPI DialogProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
{
   WNDCLASSEX WindowClass;

   static LPCTSTR szAppName = L"OFWin";
   HWND hWnd;
   MSG msg;

   WindowClass.cbSize = sizeof(WNDCLASSEX);
   WindowClass.style = CS_HREDRAW | CS_VREDRAW;
   WindowClass.lpfnWndProc = DialogProc;
   WindowClass.cbClsExtra = 0;
   WindowClass.cbWndExtra = 0;
   WindowClass.hInstance = hInstance;
   WindowClass.hIcon = LoadIcon(0, IDI_APPLICATION);
   WindowClass.hCursor = LoadCursor(0, IDC_ARROW);
   WindowClass.hbrBackground = (HBRUSH)(COLOR_MENU);
   WindowClass.lpszMenuName = 0;
   WindowClass.lpszClassName = szAppName;
   WindowClass.hIconSm = 0;

   RegisterClassEx(&WindowClass);

   hWnd = CreateDialog(
      hInstance,
      MAKEINTRESOURCE(IDD_DIALOG1),
      0,
      (DLGPROC)DialogProc
      );


   

   while(GetMessage(&msg, 0, 0, 0) == TRUE)
   {
      TranslateMessage(&msg);
      DispatchMessage(&msg);
   }


   return static_cast<int>(msg.wParam);
}



LRESULT WINAPI DialogProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   switch(message)
   {
   
   case WM_DESTROY:
        PostQuitMessage(0);
        return TRUE;
   
   case WM_CLOSE:
        DestroyWindow (hWnd);
        return TRUE;

   default:
      return DefWindowProc(hWnd, message, wParam, lParam);
      
   }

}
Back to top
View user's profile Send private message AIM Address
merlin22
Master Cheater
Ban
Reputation: 0

Joined: 29 Mar 2008
Posts: 267

PostPosted: Tue Jun 24, 2008 8:01 am    Post subject: Reply with quote

Are you using autoit in this code?
Back to top
View user's profile Send private message AIM Address
WafflesFTW
Expert Cheater
Reputation: 0

Joined: 21 Mar 2008
Posts: 131

PostPosted: Tue Jun 24, 2008 8:15 am    Post subject: Reply with quote

No... This is coded in Win32 C++
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites