|
-
Dec 17th, 2001, 11:33 PM
#1
Thread Starter
Fanatic Member
Change the Text of a Static
Let's say if I have a Static called : "st1", I would like to set the text(value) for it. How can I accomplish that? How to do that to an EDIT? To a Command Button? Also, how to set a reaction when the user clicks a button, edit, or a static?

prog_tom
JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
http://physics.sviesoft.com/forum
-
Dec 22nd, 2001, 02:11 PM
#2
Get/SetDlgItemText or Get/SetWindowText for all of them. It depends whether you have the id or the hwnd.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Dec 22nd, 2001, 02:41 PM
#3
Thread Starter
Fanatic Member
Help
Code:
/*======================================================
COPYRIGHT(C) 1999 - 2002
TOM ZHANG, 9, 1, 7, 4, 8
{'P','R','O','G','T','O','M'}
||||||||||||||||||||||||
||||||||||||||||||||||||
///////////\\\\\\\\\\\\\
\\\\\\\\\\\/////////////
========================
=======================================================*/
#include <windows.h>
#include "resource.h"
HWND dlg;
BOOL CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam){
HICON hCursor;
switch(msg){
case WM_CREATE:
hCursor=LoadCursor(NULL,MAKEINTRESOURCE(CURSOR1));
SetCursor(hCursor);
break;
case WM_INITDIALOG:
hCursor=LoadCursor(NULL,MAKEINTRESOURCE(CURSOR1));
SetCursor(hCursor);
break;
case WM_CLOSE:
DestroyWindow(hwnd);
PostQuitMessage(0);
break;
case WM_RBUTTONUP:
SendMessage(hwnd,WM_CLOSE,0,0);
break;
default:
break;
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd){
MSG msg;
HICON hCursor;
dlg=CreateDialog(hInstance,MAKEINTRESOURCE(DIALOG1),NULL,WndProc);
LoadIcon(hInstance,MAKEINTRESOURCE(ICON1));
hCursor=LoadCursor(hInstance,MAKEINTRESOURCE(CURSOR1));
SetCursor(hCursor);
if(dlg==NULL){
MessageBox(NULL,"Error","",0);
return 0;
}
ShowWindow(dlg,SW_SHOWNORMAL);
while(GetMessage(&msg,NULL,NULL,NULL)){
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
I don't know how to load CURSOR1... nor ICON1...

prog_tom
JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
http://physics.sviesoft.com/forum
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|