Guest User

Untitled

a guest
Jan 23rd, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. #define UNICODE
  2. #define WINVER 0x0A00
  3. #define _WIN32_WINNT 0x0A00
  4. #define BUFFERSIZE 100
  5. #include<wchar.h>
  6. #include<windows.h>
  7. #include <errno.h>
  8. #include<conio.h>
  9. #include<iostream>
  10. #include<stdio.h>
  11. #include<resource.h>
  12. ////////*******resource not working********/////////////
  13. DWORD g_BytesTransferred = 0;
  14. LRESULT CALLBACK WindowProcedure(HWND,UINT,WPARAM,LPARAM);
  15. IDD_DLGFIRST DIALOG 260,200,188, 95
  16. STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
  17. CAPTION "Win32 Programming"
  18. FONT 8, "MS Shell Dlg"
  19. {
  20. DEFPUSHBUTTON "OK", IDOK, 130, 10, 50, 14
  21. }
  22. INT_PTR CALLBACK DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
  23. int WINAPI WinMain(HINSTANCE hvalue,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
  24. {
  25. LPCTSTR name=L"mydailogbox";
  26. INT_PTR hDlg;
  27. MSG msg;
  28. hDlg=DialogBox(hvalue,MAKEINTRESOURCE(IDD_DLGFIRST),
  29. hnd,reinterpret_cast<DLGPROC>(DlgProc));
  30. while(GetMessageW(&msg,NULL,NULL,NULL))
  31. {
  32. TranslateMessage(&msg);
  33. DispatchMessage(&msg);
  34. }
  35. return 0;
  36. }
  37.  
  38. INT_PTR CALLBACK DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
  39. {
  40. switch(uMsg)
  41. {
  42. case WM_INITDIALOG:
  43. return TRUE;
  44.  
  45. case WM_DESTROY:
  46. EndDialog(hwndDlg,0);
  47. return TRUE;
  48. }
  49. return FALSE;
  50. }
Add Comment
Please, Sign In to add comment