|
Okay. I see. Where do you want to put the minimize button? I assume you know how to minimize the window ( ShowWindow(SW_MINIMIZE) ).
Michael
|
|
|
|
|
I'm pretty new to programming and I don't even know where to start on the minimize process.. I want the app to minimize to the tray/system bar like most other apps do by default.. Minimizing the app by the system clock would be awesome but it would probably require a lot more code and I assume it would be much more difficult, so for the time being just minimizing to the tray/system bar would be fine.
Do you have sample code I could try?
Thanks for you help and fast responses!!!!
Rob
|
|
|
|
|
Never mind the CDialog::ShowWindow(SW_SHOWMINIMIZE); worked fine
Thanks!!
Rob
|
|
|
|
|
|
Hi!
I've been searching and lurking around here looking for ways to create a GUI.
It wasn't so easy to find info so I thought I'd confront you guys with questions that swirrel around in my head.
I had to test things and appended a VM_LBUTTONCLICK to my CVIEW.
in the code I had the following:
[CODE]
CDC *dc = this->GetDC();
dc->MoveTo(point);
CButton *knapp = new CButton();
CRect rect;
rect.bottom = point.y+20;
rect.top = point.y;
rect.left = point.x;
rect.right = point.x+50;
knapp->Create("test",BS_DEFPUSHBUTTON|WS_VISIBLE | WS_TABSTOP,rect,this->GetParent(),IDC_BUTTON_EXISTING_IN_ADIALOG);
[/CODE]
This did in turn create a button everywhere I pressed the left mousebutton.
Fair enough;
What I need now is an action beeing performed on pressing that button. For instance MessageBox("some message");
Say I placed the code somewhere ELSE, in OnInitialUpdate() forinstance. Creating only one button.
Would this be a BAD and HARD way to create a GUI? Say that I would like editbox'es and stuff.
(PS: anyone know of a tutorial on how to create a GUI?)
In advance thanks, you're all great resources!
|
|
|
|
|
Can't you not use a CFormView and create your controls on the dialog resource?
Michael
|
|
|
|
|
Yeah well..
You know what?!
That idea.. You can just.. stuff it up.. hmm.. maybe..
Guess it wasn't quite so dumb afterall :P
I might just do exactly that!
Thanks man! =)
I O U 1! =)
"You know you're drunk when you can't even lie still on the floor without holding on to the floor"
|
|
|
|
|
Hi !
I have one option of a menu and I need to change the associated bitmap, in modifyMenu it asks me for a pointer to bitmap, but...
Should I take care to destroy that bitmap or the menu handles it ?
Thanks, Bye !
Braulio
|
|
|
|
|
Should I take care to destroy that bitmap or the menu handles it ?
You're responsible for destroying the bitmap. However, you should do it until the menu uses this bitmap. If you delete it earlier, you will see garbage in the menu item.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I need help bad!!!!!
I created a second toolbar in addition to the default toolbar. Everything works fine in release mode, but in debug mode, the application hangs upon exiting. If I remove the toolbar everything works okay. If I add just the definition of the toolbar and not the code, it hangs in debug mode. I'm using CToolbarEx to define the toolbar. Any ideal to what could be causing this?????
Any thought, comment or assistance would be greatly appreciated.
I found the following errors:
memory check error at 0x00D45834 = 0x00, should be 0xFD.
memory check error at 0x00D45835 = 0x00, should be 0xFD.
memory check error at 0x00D45836 = 0x00, should be 0xFD.
memory check error at 0x00D45837 = 0x00, should be 0xFD.
Could this be anything???
Thank-you
Sincerely,
RAH
|
|
|
|
|
Ctrl+Break when app hangs and have a look at the call stack. You should be able to see where's the problem.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
|
Is exiting the function right away will provide less memory movement
Don't worry about that. Worry about code readability - and in this case exiting early wins hands down.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Chances are it makes no difference which version you use, as probably the compiler redirects all returns inside a function to the same code stub. Anyway, you can always try to run a profile batch against your program to know (your VC++ comes with a profiler tool).
From the point of view of readability, my opinion is (in accordance with what others have said) that the first version is better: When you finally got to the main part of code all secondary scenarios are ruled out, and that makes it easier to concentrate on a smaller mental model of your problem. That's how my brain works at least. I guess this could make for an interesting discussion subject at the lounge.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
second option generates a higher jump value than the first one
So what? How many nanoseconds do you want to save? I think you're wasting your time on totally irrelevant stuff.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
|
In a 3d engine, nothing is Irrelevant when it's about optimization
Bullshit. In function like this you're checking if file exists. This means you have to call underlying OS, which usually causes context switch. This operation alone takes orders of magnitude longer than time saved with possible 'optimization' after rearranging control flow.
As Michael Abrash writes in his "Graphics Programming Black Book":
Know when it matters. (identify the portions of your program where peformance matters, and don't waste your time optimizing the rest.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
|
But let say this function is called every cycle
Are we still talking about bmpLoader function? Do you suggest that you'll be loading bitmaps from disk in tight, time-critical loop?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have made a DLL. I have used it from SDI program. I want to send a message from dll through SendMessage() to view of SDI.
I have written the message handler as well. I have registered the message on both dll as well as application (that is SDI)
Luck favors the prepared mind.... [Under Siege 2]
Regards Naveed.
|
|
|
|
|
I have created a help file external to vc++, but i can not figure out how to run it.
I have created a message map
ON_COMMAND(ID_HELP,OnHelp)
I have created a OnHelp function
What do i need to put in the OnHelp function to startup the help file?
Or am I looking at this from the wrong direction
thank you ?
|
|
|
|
|
From MSDN:
WinHelp
Starts Microsoft® Windows® Help (Winhelp.exe) and passes additional data that indicates the nature of the help requested by the application.
BOOL WinHelp(
HWND hWndMain,
LPCTSTR lpszHelp,
UINT uCommand,
DWORD dwData
);
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
In a class,I want to put the method's address to a DWORD value.
How to do it? or can I access the vtable of the class?
hi
|
|
|
|
|
You can't do that in a portable way. Why do you need this functionality?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|