Some stupid Windows Questions...

Started by
6 comments, last by Arek the Absolute 22 years, 4 months ago
First off, sorry if this isn''t the right board for this kinda thing, but I couldn''t find any that are particularly related to this. Thanks in advance if you can answer any of these. 1) I have a dialog box with an edit box in it. The edit box is initially disabled. How can I enable the edit box at a later time? And why is such a thing so undocumented? 2) How can I have a list of all the files in a directory? If I''m wording that wrong, look at almost any programs File Open dialog box. How can I have it display the contents of a directory? 3) Can anyone point me towards a good tutorial on how to write a simple windows text editor? I can''t seem to find any in C++ for some reason... Thanks again! Arek the Absolute
-Arek the Absolute"The full quartet is pirates, ninjas, zombies, and robots. Create a game which involves all four, and you risk being blinded by the sheer level of coolness involved." - Superpig
Advertisement
Use EnableWindow(hWnd); (hWnd is the handle to your Edit Box)

---------------

I finally got it all together...
...and then forgot where I put it.
Oops, sorry, u have to pass a second parameter to EnableWindow - a BOOL indicating whether it should be enabled or disabled:

EnableWindow(hWnd,TRUE); //Enables it
EnableWindow(hWnd,FALSE); //Disables it

Hope this helps...

---------------

I finally got it all together...
...and then forgot where I put it.
quote:Original post by Arek the Absolute
2) How can I have a list of all the files in a directory? If I''m wording that wrong, look at almost any programs File Open dialog box. How can I have it display the contents of a directory?

See FindFirstFile, FindNextFile, etc...

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
quote:Original post by Arek the Absolute
2) How can I have a list of all the files in a directory? If I''m wording that wrong, look at almost any programs File Open dialog box. How can I have it display the contents of a directory?

You can do what Oluseyi suggested, but you probably want to look at the Win32 common dialogs. Take a look at this page.

[Resist Windows XP''s Invasive Production Activation Technology!]
One more Q, Admiral Binary...
This is a REALLY stupid question, but what''s the best way to get the handle to the edit box, then? I understand handles to the dialog box, windows, and all that stuff, but I''m missing something there. How do I get the handle to an item within the dialog box...?

-A very ignorant Arek the Absolute
-Arek the Absolute"The full quartet is pirates, ninjas, zombies, and robots. Create a game which involves all four, and you risk being blinded by the sheer level of coolness involved." - Superpig
Use GetDlgItem(DialogHandle, ItemNumber).

[Resist Windows XP''s Invasive Production Activation Technology!]
A good source of information is at Ju Rao''s computer books. He has links to a lot of free online books, including Teach Yourself Visual C++ 6 in 21 days.

---
Make it work.
Make it fast.
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][LWJGL Tutorials for NeHe][LWJGL Wiki][jMonkey Engine]

This topic is closed to new replies.

Advertisement