|
|
Is your problem solving? and if you have a variable for your button you can use form it
|
|
|
|
|
>>Yeah, but how do I do that with the designer?
If you want it disabled by default...
Highlight the control, press F4 for the properties window, and change the Disabled property to
TRUE.
Mark
|
|
|
|
|
Alright! That solved it, thanks you two!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Please tell how to change the cursor when i move it into rectangle (100,100,200,200).
Thank you for helping
all for development
|
|
|
|
|
Do you need to LoadCursor and SetCursor ?
|
|
|
|
|
//Win 32 Application
//Hello world program
CALLBACK Winproc(HWND,Message,wParam,lParam)
Switch(wId)
...
....
case WM_MOUSE:
if(condition)
{
HWND hCursor=LoadCusor(hInst,(LPSTR)IDI_NEWCURSOR);
SetCurspr(hCursor);
else
.......
When condition ==1 ,the cursor not change.
Help me.
all for development e
|
|
|
|
|
I want to help you but what question?
|
|
|
|
|
Handle WM_SETCURSOR and if the cursor is within that rect, call SetCursor() to change it.
|
|
|
|
|
I've conclued I don't really know how to get handles to objects in VC++. They are referred to all the time, and I get the idea they are one of the basic tools of VC++ along with pointers. The books and manuals all talk about handles, but presume the reader is bright enough to know how they all work. I'm not. (Someone who knows what they are doing could write a great article titled, "Handles for Beginners")
So.....
Suppose I have:
dialog: CTestDlg
edit control: IDC_EDIT1
member function: CTestDlg::FuncTest
Exactly how would one get handles to any or all of these? I suspect one starts with
"HWND hHandle = ???????"
But what goes on the right side of the expression?
Thanks.
|
|
|
|
|
Handles are a Windows concept - they are just used in VC because VC normally is used for Windows programming. They are similar to a pointer in that they store an index into some internal table. By looking up that index, Windows can find the actual data that manages the window. But as far as you are concerned, a handle is just some opaque number you can pass around to various Windows functions.
For the dialog - there should be something like pTestDlg->getHwnd() or whatever the MFC equivalent is.
To get a handle to a control, call ::GetDlgItem(hDialog, IDC_EDIT1); where hDialog is an HWND obtained by using a method above. Alternatively, if IDC_EDIT1 is represented by an MFC class, just call the getHwnd equivalent on that class.
Member functions cannot have handles. A handle is used by Windows - but a member function is just a special type of function. You can create a pointer to a member function, but the syntax is ugly and very limited as to what you can do. Or you can search for fastdelegate on CodeProject to find a member function pointer wrapper.
Mike
|
|
|
|
|
Hi,
I dont know what exactly do you need by I am suspecting you want to get a HANDLE to the IDC_EDIT control. If this is the case,
You can use the following
CWND* pwnd=this->GetDlgItem(IDC_EDIT1);
it will return a pointer to that EDIT CONTROL. But this is CWND pointer; if you need the HWND then
CWND has a member variable m_hwnd which is public.
So
HWND handle=pwnd->m_hwnd;
But I guess, if you are using MFC, the pwnd is enough to do something to the window like writing a text, for example.
pwnd->SetWindowText("Text");
Regards,
Angbo2006
|
|
|
|
|
|
Thanks for the help. I didn't have an immediate and particular need, but I simply recognized a deficiency in my understanding of how to get a handle. So, I try to formulate a tight question that will shed some light. When I see correct code that does something, and understand its intent, then I can backtrack through the manuals and get a full understanding. (I guess that is my learning style.) I found the four volume MFC reference library in a used book store for $2 each, and have been reading about all these great classes and functions. However, the difficulty arises in understanding exactly how to write the code to get the required arguments for the functions.
Thanks again
|
|
|
|
|
Could somebody please point me towards the correct set of functions to create a full screen window. I have a window ( 800 x 600 ) which I need to view in full screen, but I will need to change the screen resolution in order to this. All the articles I have found so far simply resize the window and remove the titlebar. This is not the effect I want. I should also note this has to be done without MFC or ActiveX.
|
|
|
|
|
Can you explain I guess your question isnt for a change simple size
|
|
|
|
|
The window has a bitmap skin, so really resizing isn't an option. In order for the window to become full screen I will also need to change the resolution to match that of the bitmap. I have seen this done with lots of games, so I know it's possible, I just don't know how.
|
|
|
|
|
In the CreateWindow function, the third parameter is the window sytle, change it to:
WS_EX_TOPMOST | WS_POPUP | WS_VISIBLE
Like this (in WIN32):
<br />
wndHandle = CreateWindow (<br />
TEXT("Full screen"), <br />
TEXT("Full Screen"), <br />
WS_EX_TOPMOST | WS_POPUP | WS_VISIBLE,<br />
CW_USEDEFAULT, <br />
CW_USEDEFAULT, <br />
1280, <br />
1024,<br />
NULL, <br />
NULL, <br />
hInstance, <br />
NULL );<br />
Hope that helps.
|
|
|
|
|
That will allow me to place the window over the Task bar, but I still need to change the resolution of the screen, and be able to restore it later. I'm currently searching for an easy way to do this.
|
|
|
|
|
You are writing a game, aren't you? I know what you want to do, you need to write your own Graphics manager to do initalize all this little details.
|
|
|
|
|
haha. Yes it is a game, but this window is only a small part of the game which will be contained within a dll. The main game window will have full use of the graphics system, but fr this little window there is no point.
|
|
|
|
|
Hi,
You need to call ChangeDisplaySettings as below
DEVMODE devm;
devm.dmSize=sizeof(DEVMODE);
devm.dmPelsWidth=NewPelsWidth;
devm.dmPelsHeight=NewPelsHeight;
devm.dmFields=DM_PELSHEIGHT|DM_PELSWIDTH;//|DM_BITSPERPEL;
UINT b=ChangeDisplaySettings(&devm,0);
//test b for success
Regards,
Angbo2006
|
|
|
|
|
int iX = GetSystemMetrics(SM_CXSCREEN);
int iY = GetSystemMetrics(SM_CYSCREEN);
DEVMODE dm;
dm.dmSize = sizeof (DEVMODE);
dm.dmPelsWidth = iX ;
dm.dmPelsHeight= iY ;
dm.dmBitsPerPel= 32 ;
dm.dmDisplayFrequency = 75 ;
dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT |
DM_BITSPERPEL | DM_DISPLAYFREQUENCY;
ChangeDisplaySettings(&dm,CDS_FULLSCREEN);
MoveWindow(0,0,iX,iY);
|
|
|
|
|
Hello everybody
I would appreciate it if I can get help adding a picture into my program. I'm using visual c++ 6. This must really be simple, I just need the picture on my main dialog, but the program should be able to run without having the bitmap with it.
thanx...
KOM UIT DAAAAA!!!
|
|
|
|
|
You can import bmp file to resource and use of CBitmap::LoadBitmap for load use of WM_PAINT or WM_ERASEBKGND for draw it,but my suggestion is you reading your file from disk instead import it to your project because it increase size of your exe
|
|
|
|