|
Hi Erik,
You should be able to show a dialog from a console application just the same way as in a GUI application.
Create a dialog resource and implement a dialog procedure, then call one of the CreateDialogXXX (for a modeless dialog) or DialogBoxXXX (for a modal dialog).
Cheers,
Paolo.
|
|
|
|
|
Can I make the modeless dialog stay on top, and have the console drawing something in the dialog, too?
Could you show me an example?
Thanks.
|
|
|
|
|
Hi Erik,
I think you can do that. To have the dialog always on top try:
SetWindowPos(hWndDialog, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
To draw on the client area of the dialog, first get a device context then just draw in it:
HDC hDC;
hDC = GetDC(hWndDialog);
TextOut(hDC, 10, 10, TEXT("Hello World!"), 12);
ReleaseDC(hWndDialog, hDC);
Hope this helps,
Paolo.
|
|
|
|
|
i have problem in list box for particular condition i should display the text in the different color anybody suggest what to do
|
|
|
|
|
You'll need to owner-draw the text. List boxes are ooooold and don't have many features.
Is it possible for you to switch to a list view control? It's trivial to change text color in such a control. I have written a tutorial on using custom draw that explains how to do it.
|
|
|
|
|
Try
http://codeguru.earthweb.com/listbox/colorlb.shtml
Mike's right List Boxes are pretty ooooollllldd
But in some scenarios they can be more useful than
List Controls
Regardz
Colin Davies
|
|
|
|
|
I sent you a class via email that does the following things:
1) Calculate horizontal scroll distance based on longest string in the listbox
2) Add or Insert strings with a specified color
3) Increase distance between listbox items
|
|
|
|
|
When ICQ approaches the screen edges, it docks there.
Other windows will have their maximum window size reduced (e.g. maximum width=screenwidth-icqwidth, maximum height=screenheight-icqheight)
How can I change the maximum size of all windows in the desktop? Are there any methods that I can change the windows in desktop environments?
Thanks all!
|
|
|
|
|
Unsure How ICQ works,
Generally this sort of feature is done by creating an "appbar"
Like the windows bar or office bar, and a few ticker tape controls,
Search out "AppBar"
Regardz
Colin Davies
|
|
|
|
|
I have an ATL control with a contained TreeView (using CContainedWindow).
The treeview flickers like you wouldn't believe when resized dynamically (the user can stretch its size in the container I am using). I have determined that the flicker is not due to the parent window of the tree.
Any ideas? I'm fresh out... To witness this phenomenon, use the ATL wizard to generate a control based on a treeview. Populate the tree with some items. Place the control on a VB form, and dynamically resize the control in the form's Resize event. Flicker city.
Nick Hodapp
|
|
|
|
|
Create the Treeview without the WS_HSCROLL and WS_VSCROLL styles. There is a KB article on the subject but I don't have the number. MS states that the complete redraw is intended when these styles are active.
|
|
|
|
|
How can I make it so a utility is automatically loaded when windows starts? (without putting it in the startup folder).
I am sure this has simple, but I have had a look round and can't find any info.
Thanks for any help you can give,
David Wulff
|
|
|
|
|
Hi David,
You may write a value in the registry under the key *ROOT*\Software\Microsoft\Windows\Current Version\Run, where *ROOT* can be HKEY_LOCAL_MACHINE (all users, if you have enough rights) or HKEY_CURRENT_USER (only current user).
I don't know or can't remember if that can be done with an API call, maybe one of the Setup API.
Paolo.
|
|
|
|
|
I am now adding an entry to the ..\Run key with the utility path, and it is running fine each time I log in.
Is it possible though to do it another way. So long as the product is installed, this uitility must be present when the user is logged in (it's a kind of auto-change detect / restore utility very simialr to SourceSafe(r)). If it isn't loaded then the user will be able to get around password protected files and folders using this system.
I doubt many people will edit the registy to get rid of it, but some people might, and I need to gt around this.
I have tried creating the entry in the rgistry as read only, but it doesn't work.
Thanks in advance for any help, and excuse my bad spelling,
David Wulff
|
|
|
|
|
Hi David,
Don't worry for the spelling, many people here hasn't got English as mother tongue. I'm Italian...
The problem is: every user can terminate the utility at any time, with TaskManager on NT/2000 or by pressing CTRL+ALT+DEL on Win9x.
You can't safely protect the files this way, but really solving this problem involves the creation of a Service (only on WinNT/2K) or maybe a Device Driver.
You may have a program act as a service on Win9x by calling RegisterServiceProcess(), but I can't tell you more, this goes far beyond my knowledge...
I don't know if there's a simpler way...
Maybe you could consider writing a shell extension, which is loaded by Explorer and, running in a DLL, can't be terminated without terminating Explorer. Restarting Explorer after such an operation would reload your DLL too.
Manually removing a Shell Extension from registry is not a simple operation, and most users and even programmers are not able to do it.
I can't tell you which type of extension to implement and exactly when your DLL gets loaded by Explorer, but you may start reading the articles you find on CodeProject about Shell Extensions (there are some tutorials too).
You also have to pay attention to the fact that your code would run in a DLL, that is in the process space of Explorer, so an unexpected condition could crash Explorer too.
I don't know if this is the right approach to the problem...
You should ask someone else, or someone else should reply to you
Paolo.
|
|
|
|
|
----
Don't worry for the spelling, many people here hasn't got English as mother tongue. I'm Italian...
----
That's just it though, i'm British!
Thanks for the reply. I'll have a look using the approaches you mentioned, they cerainly sound doable.
|
|
|
|
|
Our entire development team here has been suffering from a strange VC IDE problem. I was wondering if any of you have come across this.
Our project is pretty big. 10 dsp files around 4000 files and 3.5 million lines of code.
Often during development, the IDE stops responding, the CPU gets pegged at 100 (or near there) and no redraws happen in the IDE. On my 650MHz machine (with 256MB of RAM) this state lasts 10-15 minutes and then all resumes. It got better when I added tons of header files to the MSVCINCL.DAT files is used to exclude files from the file dependencies. I talked to MS tech support and they said that it seems to be a dependency update pause (!). They said the file limit is around 9600 files so that isn't it.
One of my co-workers got a GHz machine and the pause is barely perceptable.
I was wondering if there are any work-arounds any of you know about?
TIA
Woolie
|
|
|
|
|
Often the workspace .ncb file will become corrupt, and this can cause a lag. Also, best of luck to you if you are using VSS...
You can safely delete the workspace .ncb file. It will get regenerated. If you find this fixes your problem, you may wish to write or find a utility to delete the file automatically. Several exist, though I will shamelessly plug one I wrote called NukeNCB.
Best of luck,
Nick Hodapp
|
|
|
|
|
Like Nick, I've found that deleting *.ncb files seems to cure almost every problem I have with the IDE.
I don't use any VCS system yet but I make zip backups of my source directories at least once a day. I've got the batch file that does the zipping setup to delete any .ncb files, among others, before it makes the archive.
Be aware that the *.ncb file is locked while the project is loaded in the IDE. I seem to recall that the IDE occasionally fails to release the file lock when you close a project from the File menu. I now just exit the IDE to make sure that everything is closed properly.
|
|
|
|
|
Howdy all.
First, I want to apologize for what I am about to do. Yes, I am going to ask a how to related question.
See, I am messing with CListCtrl objects and find that I want to insert an image in a subitem. I can do this, it isn't hard. My problem is that once the subitem image is added, the main item also seems to be forced to have an image. I was wondering if anyone else had this happen to them.
Thank you.
|
|
|
|
|
I messed around with it for a few minutes, and it looks like just doing a ListView_SetImageList() call forces every column 0 item to have an icon.
I.e., if you do:
LVITEM i = {0};
i.mask = LVIF_TEXT;
i.pszText = _T("blah");
ListView_InsertItem ( hwndList, &i );
The "blah" item gets image #0 in the image list, even though LVIF_IMAGE wasn't in the mask.
|
|
|
|
|
Hi.
Please, i want to add two different color lines to a EditBox, dunno if it's possible, i want by example, one red and one blue.
Can anyone show me the code on how to do this?
Thanks in advance.
Regards, James.
|
|
|
|
|
I want to download a file using WinInet API/MFC. I can't use FTP. File might be any type such as bmp, dwg, or doc. Any ideas???
Thanks in advance.
|
|
|
|
|
|
I ran your exe. I got error download failed: Error 80004004 during download. I tried to download asp and dwg files. I tried to download file http://www.mindcracker.com/my/mh.dwg
Any ideas?
Thanks for your help.
Mahesh
|
|
|
|