Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef DRAKE_INPUT_BOX_H
- #define DRAKE_INPUT_BOX_H
- #include <windows.h>
- #include "DrakeInputBoxResource.h"
- #include <string>
- using namespace std;
- //Global variables
- int QueryLen;
- char *QueryCaption, *QueryText, *QueryDst;
- BOOL CALLBACK QueryDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
- {
- switch (uMsg)
- {
- case WM_INITDIALOG:
- {
- SetWindowText(hwndDlg, QueryCaption);
- SetDlgItemText(hwndDlg, IDC_QUERY_TEXT, QueryText);
- SetDlgItemText(hwndDlg, IDC_QUERY_EDIT, QueryDst);
- return TRUE;
- }
- case WM_COMMAND:
- {
- switch (LOWORD(wParam))
- {
- case IDOK:
- {
- char *buf = "";
- GetWindowText(GetDlgItem(hwndDlg, IDC_QUERY_EDIT), buf, QueryLen);
- EndDialog(hwndDlg, IDOK);
- return TRUE;
- }
- case IDCANCEL:
- {
- EndDialog(hwndDlg, IDCANCEL);
- return TRUE;
- }
- }
- }
- }
- return FALSE;
- }
- string InputBox(char *caption, char *text, int len)
- {
- char *dst = "";
- QueryCaption = caption;
- QueryText = text;
- QueryDst = dst;
- QueryLen = len;
- DialogBoxA(0, MAKEINTRESOURCE(IDD_DLG_QUERY), 0, QueryDlgProc);
- return dst;
- //return (DialogBox(0, MAKEINTRESOURCE(IDD_DLG_QUERY), 0, QueryDlgProc) == IDOK);
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement