|
Use MSDN to fully answer some of these questions, but I also suggest picking up a book about Windows programming.
Here's what I know:
Whenever a window is created, resized, clicked on, destroyed, whatever, Windows (the operating system) sends a corresponding message to the callback function tied to it (the window). WM_CREATE is the ID of the message sent to that function (by Windows) at the moment the window is being created. If the programmer needs to do something at that time, he checks for that message (inside the function) and does something. If he doesn't care about it, he doesn't do anything and the window continues being created.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Recommend any super duper good book?
Appreciate your help,
ns
|
|
|
|
|
I don't have anything off the top of my head. I've heard that Charles Petzold puts out great Windows programming books. You may search him out on the web.
Also, you may wanna do a Search on this forum, or the Lounge maybe to see what other people have recommended. I'm sure this question (what book do you recommend?) has been asked many times here before.
Good luck and don't worry, it will all make sense before you know.
Alvaro
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
|
|
|
|
|
hi all, i need to make a dialog that takes over full screen,
and cannot be exited by any hot keys / ctrl-alt-delete combinations.
im going to build a pass-protected exit area of the code and make the computer autostart this program on reboot because it will be used by consumers in a store that are unsupervised, and i dont want them f***ing around in my computers.
any good suggestions on easy ways to make the dialog take full screen, and override all keyboard input to do nothing....???
todo....
:: insert inpirational text here ::
|
|
|
|
|
Think keyboard hooking function and consider MoveWindow function
to start with windows add a key in the registry under local machine\software\microsoft\window`\current version\run
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Well, that was easy enough, i got the dialog to be fullscreen.....
but now i still need to figure out how kill all hotkeys (altf4, ctrl-esc, ctrl-alt-delete, erc). i need to keep the regular typing keys actually because people will need to fill in survey information.
suggestions greatly appreciated
todo....
:: insert inpirational text here ::
|
|
|
|
|
http://msdn.microsoft.com/msdnmag/issues/02/09/CQA/default.aspx
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
that would be good ,but i want to do it programmatically, as if i do not have any access to the target computer.
also, id rather hookup a function to throw away all keyboard input except a-z and 1-9 , so that alt-f4, ctrl tab, ESC, and other escape mechanisms wont be possible, the article doesnt address the other escapes.
todo....
:: insert inpirational text here ::
|
|
|
|
|
I have an MDI project that has two views and only 1 document. View 1 spawns a number of modeless dialogs. Then I switch from view1 to view2. THee views are contained within mainframe. THe modeless windows from view 1 show up over view 2. What I need is to have view2 obscure the modeless dialogs. Then when I switch back to oview 1, I want view 1 to appear UNDER the modeless windows exactly as things were before I switched over to view 2.....
How do I do this?
Thanks
Appreciate your help,
ns
|
|
|
|
|
I have a CEdit on a dialog box that pops up from a button on a MDI MFC project. Its modeless. If I stretch this dialog, I want the window to maintain its height, but stretch horizontally. Plus I want it to wrap the text around and develop scrollbars if necessary. How do I organize this? What functions Do I need here?
Appreciate your help,
ns
|
|
|
|
|
Hi,
I am familiar with registry saving functions. However I dont know what to save here:
The main app spawns any desired number of dialogs. THe user say spawns 6 windows, sizes them, and places them in some locations on the screen. When he exits and then later starts up the program he wants the UI to come up like he left it. WIth 6 dialogs spawned , in exactly the same locations and of the same sizes as he left them. What are the settings to save and how do we get them?
1. How to get locations on screen?
2. hOw to get sizes of the dialogs?
3. Initially you have to press a menu item "Create ViewBox" to spawn the window.one click - one window ...etc.
So when the app starts up again, this time the user isnt clicking the menu 6 times. They just magically show up.
How do we get these three things done? I can svae in the registry and read from the registry but dont know what I am saving. Also after I read the variables I have saved, how do I use them to magically create the 6 (or n) dialogs? These will be a class say CViewBox associated with an IDD_DIALOG1.
Appreciate your help,
ns
|
|
|
|
|
To save
WINDOWPLACEMENT myPos;
::ZeroMemory(&myPos, sizeof(WINDOWPLACEMENT));
myPos.length = sizeof(WINDOWPLACEMENT);
if(GetWindowPlacement(hWnd, &myPos))
WritePlacementInfo(&myPos);//however you store it - disk, registry etc..
To restore
WINDOWPLACEMENT myPos;
::ZeroMemory(&myPos, sizeof(WINDOWPLACEMENT));
myPos.length = sizeof(WINDOWPLACEMENT);
if(ReadPlacementInfo(&myPos)) //read it from where you saved it
{
myPos.showCmd = (myPos.showCmd == SW_SHOWMINIMIZED)? SW_SHOWNORMAL:myPos.showCmd;
SetWindowPlacement(hWnd, &myPos);
}
|
|
|
|
|
Thanks. Did this also save the dimensions of the dialog?
Or is that another bit of information? I need to know about that too.thanks
Appreciate your help,
ns
|
|
|
|
|
Yes, see definition of WINDOWPLACEMENT and GetWindowPlacement
|
|
|
|
|
How can I dynamically load a dialog from an MFC extension dll?
|
|
|
|
|
Create a CDialog -derived class in the DLL that implements the dialog. Use that in your application.
DLL:
AFX_EXT_CLASS class MyDialog : public CDialog {
};
Application:
MyDialog dlg;
dlg.DoModal();
Software Zen: delete this;
|
|
|
|
|
|
I have an application that assembles a set of data into a memory device context which is then taken line by line and output to an external device. Some of what gets put into the MemDC includes text (for labels, etc), and I create a CFont object and then use TextOut to render the text on the MemDC.
When the screen is set to 8-bit color, everything works fine and the text is normal and as expected. When the screen is changed to 16-bit color, the font look enlarged and as if it is missing every other pixel. Alignment and positioning also get whacked.
What should I be paying attention to in order to get a 12-point font to be rendered properly in both 8- and 16-bit color modes, as well as in 24- and 32-bit color if the user has their screens set to that? We started using 8-bit color because the image data is 0-255 values and is palette based.
Any suggestions and pointers will be greatly appreciated.
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
at www.aoi.it, there is cximage (v5.50) with a DrawText method that works fine in every screen resolution.
|
|
|
|
|
Hello there,
Does anyone know how to determine programmatically which Windows XP style/theme (i.e. Windows XP, classic, etc) is in use?
I owner-draw my own caption bar and on other OS's I can use CDC::DrawFameControl which nicely draws the correct buttons in the correct place. However DrawFrameControl on XP not only draws the buttons incorrectly, it changes the entire style of the window to be old-style too.
I need to owner-draw different buttons dependent on the current theme.
Any suggestions would be appreciated...
Thanks
Liam Elliott
Software Developer
Prism Sound
|
|
|
|
|
User DrawThemeBackground with correct themedata from OpenThemeData() function, You can easily find information about this at google
|
|
|
|
|
Hi,
I'm trying to read (binary) data from stdin, using fread. Of course, if I try to make fread read more than is available in the buffer, it blocks. Is there a way I can check how much is available to read before actually issuing the fread call?
thanks
Jon
#include <beer.h>
|
|
|
|
|
Depending on what binary data you are reading, there should be a "smallest unit" of data that you know about. If you are reading single bytes, then obviously a byte is the smallest unit. Same if you know you are reading words or dwords. If you are reading user-defined structures, then you read 1 structure of X bytes.
With that in mind, you do a read and then check the return value to see if there was data or not. This is assuming, of course, that you know the structure of the binary data you are reading.
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
Hi,
I am writing a program to append two or more GSM wave files but I need more information about GSM wave files format. Where can i find them and how to append GSM files.
Please help...
|
|
|
|
|
Hi All,
here is the link( www.tu-bs.de/~y0017025/image.htm )in which i have
posed my problem. Am new to image processing.
Any help is highly appriciated.
Thanks!!
--Sridhar
|
|
|
|