hi KetilO, First thanks for your good work.
Then I have a question, When I add a IPAddress in my RC, The windows will not show normally, Am I do anything wrong ?
I have test it , even I make a new window without anything, just a IPAddress, the window also donnot appear normally.
can you give me any advices? Thank you.
best regards
Then I have a question, When I add a IPAddress in my RC, The windows will not show normally, Am I do anything wrong ?
I have test it , even I make a new window without anything, just a IPAddress, the window also donnot appear normally.
can you give me any advices? Thank you.
best regards
The following is my test codes
test.asm
test.rc
test.asm
.386
.model flat,stdcall
option casemap:none
DlgProc proto :DWORD,:DWORD,:DWORD,:DWORD
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
.data
DlgName db "MyDialog",0
AppName db "Dialog Box",0
.data?
hInstance HINSTANCE ?
CommandLine LPSTR ?
buffer db 512 dup(?)
.const
IDD_DLG1 equ 1000
IDC_EDT1 equ 1001
IDC_IPA1 equ 1002
IDC_BTN1 equ 1003
.code
start:
invoke GetModuleHandle, NULL
mov hInstance,eax
invoke DialogBoxParam, hInstance,IDD_DLG1,NULL, addr DlgProc, NULL
invoke ExitProcess,eax
DlgProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
.IF uMsg==WM_INITDIALOG
invoke GetDlgItem, hWnd,IDC_EDT1
invoke SetFocus,eax
.ELSEIF uMsg==WM_CLOSE
invoke EndDialog,hWnd,NULL
.ELSEIF uMsg==WM_COMMAND
mov eax,wParam
.IF lParam==0
.ELSE
mov edx,wParam
shr edx,16
.if dx==BN_CLICKED
.IF ax==IDC_BTN1
invoke SetDlgItemText,hWnd,IDC_EDT1,ADDR AppName
.ENDIF
.ENDIF
.ENDIF
.ELSE
mov eax,FALSE
ret
.ENDIF
mov eax,TRUE
ret
DlgProc endp
end start
test.rc
#define IDD_DLG1 1000
#define IDC_EDT1 1001
#define IDC_IPA1 1002
#define IDC_BTN1 1003
IDD_DLG1 DIALOGEX 6,6,194,106
CAPTION "test IP"
FONT 8,"MS Sans Serif",0,0
STYLE 0x10CF0000
BEGIN
CONTROL "",IDC_EDT1,"Edit",0x50010000,60,16,76,13,0x00000200
CONTROL "",IDC_IPA1,"SysIPAddress32",0x50010000,56,46,84,13
CONTROL "ok",IDC_BTN1,"Button",0x50010000,82,75,36,15
END
Hi
Try to insert the following lines before showing the dialog.
.data?
iccex INITCOMMONCONTROLSEX <?>
.code
mov iccex.dwSize,sizeof INITCOMMONCONTROLSEX ;prepare common control structure
mov iccex.dwICC,ICC_INTERNET_CLASSES
invoke InitCommonControlsEx,addr iccex
KetilO
Try to insert the following lines before showing the dialog.
.data?
iccex INITCOMMONCONTROLSEX <?>
.code
mov iccex.dwSize,sizeof INITCOMMONCONTROLSEX ;prepare common control structure
mov iccex.dwICC,ICC_INTERNET_CLASSES
invoke InitCommonControlsEx,addr iccex
KetilO
Ok KetilO, I have solved this problem the same way just you have written, thanks anyway.