|
I have a program that is an SDI. I use much of it just as a menu bar to control other windows on my machine. It would be helpful if I could just attach this menu bar to, say, the top of the screen, or perhaps the top left corner of my screen. Is there a way for me to dock my program to an edge of the screen?
Danny
|
|
|
|
|
Hi folks,
I'm the process of moving the company product from Visual Studio 6 (VC++ / MFC) to studio 2003. Has anyone got any tips they could share with me about pitfalls etc.? Or maybe some website articles on this topic?
It's strange having to get to grips with a new IDE after all this time. There's a few things I can't find (and I've had a good look!). Have MS removed the 'Set active configuration' feature that was in v6? Or have they renamed it? The workspace ("solution"?) I'm upgrading contains 5 projects, each with debug and release configs - can I set which is active, or will I need to close the workspace and open the specific project to achieve the same result?
One more question: can I still use MFC 6 with this version of studio, or will I need to move to MFC 7?
-Dy
|
|
|
|
|
One pitfall I know is this:
In MFC6 the MakeLower and MakeUpper functions of CString make the string object itself lower- or uppercase. In MFC7, the return value is the changed string, the string object itself is untouched.
So, if you are using these functions, keep this in mind...
Geert
Want to spread the newest version of your software automatically for free? Use Updater!
Visit my website: www.gvhsoftware.org
|
|
|
|
|
anything that works on VC6 will also work in VC7 ??
|
|
|
|
|
That depends on your definition of work. Geert has already mentioned that CString::ToUpper() and CString::ToLower() have changed. They still work, but how you use them might have changed.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
For the active configuration, right click in the Solution (the root of the tree in the Solution Explorer) and choose "Configuration Manager". The same option is also in the "Build" menu.
To change the active project, you can right click on a project and select "Set as StartUp Project". It's also in the "Project" menu.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hi all. I am seen a lot of different sample on the internet and they uses the "::", "." and "->" operators differently even in the same situation. For example, some of them use
ServiceAccount.LocalSystem, and when I compile mine under VC.Net 2003, i must use ServiceAccount::LocalSystem to refer to the Account Type. Can anyone tell me why is it?
|
|
|
|
|
|
In C++, :: refers to a static or namespace member, . refers to a member of a variable and -> refers to a member of a pointer. In C#, it's . all the way.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
HI,
below is a piece of code.
HWND hVWnd;
RECT rRect;
GetWindowRect(hVWnd,&rRect); //I have checked that it returns non zero value
diff_val = rRect.bottom-rRect.top;
If on starting a application if my window is minimized then value of rRect.top and
rRect.bottom is -32000.
Is it a garbage value or any valid error code?
Once my window get normal size it gives me a valid wondow cordinates. (such as 405, 395 ..)
my question is,
when a window is minimize then GetwindowRect's top propery is always -32000.
or it could be any other garbage value.
Waiting for your reply
Many thanks
dipak mistry
|
|
|
|
|
You got your answer here[^] didn't you?
Just use ::IsIconic(..) to determine if a window is minimized. If not, get the client rect.
Geert
Want to spread the newest version of your software automatically for free? Use Updater!
Visit my website: www.gvhsoftware.org
|
|
|
|
|
Thank u very much for quick reply
|
|
|
|
|
I had noticed that the values ALWAYS seem to be the -32000 if it is minimized into the taskbar. I was using GetWindowPlacement, and I don't do that if the window IsIconic any more.
|
|
|
|
|
|
if it is a dll, use regsvr32
Geert
Want to spread the newest version of your software automatically for free? Use Updater!
Visit my website: www.gvhsoftware.org
|
|
|
|
|
that is only good for installing in proc COM servers, not device drivers.
Nunc est bibendum!
|
|
|
|
|
Setupdi functions.
Nunc est bibendum!
|
|
|
|
|
hi,
using my program, i want to start an application, let's say internet explorer, or outlook. afterwards i want to set the focus to this application, move it, and maximize it. i need some help, and here are my questions:
1. to start the program i have tried this function, but it crashes.
_wexeclp((wchar_t*)("C:/Program Files/Internet Explorer/iexplore.exe"),NULL);
It says the arguement list cannot be NULL, but i do not know what to put there as argument.
how can run another application?
2. what function can i use to get the path of the program files "C:\program files"? There is a function called "GetWindowsDirectory", but could not find one for program files.
3. after running the application, i am thinking of capturing it with a hook to set the focus on it, to move and change the size of it. is it right? is there a simpler solution? it won't not only internet explorer that needs to be started. i might need to start another program on some other user event.
Thanks in advance
caykahve
|
|
|
|
|
1. Check out the ShellExecuteEx() function
2.
SHGetSpecialFolderPath(NULL, sTemp.GetBuffer(_MAX_PATH), CSIDL_PROGRAM_FILES, FALSE);
3. See 1
Geert
Want to spread the newest version of your software automatically for free? Use Updater!
Visit my website: www.gvhsoftware.org
|
|
|
|
|
Thanks a lot. I can get the program files folder path, and can run other processes using ShellExecuteEx now.
I can get the process handle as HANDLE, but how can I get the CWnd * of the windows that I open? I want to use SetWindowPos() function, therefore i need it.
Thanks,
Caykahve
|
|
|
|
|
I wrote a similar program that the majority of its funcitonality is starting other programs and controlling where on the screen they are placed.
1. To start the other program I actually open up a batch file (.bat You can also use the .cmd extension now, too.) I write in a few lines to the batch file such as: cd "C:\Program Files" That line would change the directory to "Program Files". You can put in the path name of whatever program you want to start. And then: iexplore "http:\\www.google.com" That line would start internet explorer and bring it to the google page.
3. I use a function called EnumWindows(). This function will enumerate all the open windows on the machine. Look at MSDN for this, but you will have to write your own function to tell it what to DO with each window it checks, but in that function you can do something like EnumWindowsMine(HWND hWnd, LPARAM fail) and then use functions like GetWindowText() or GetClassName(). These also you can look up on MSDN. In this way, you can use either the class name of a window or the text of a window to check to see if this window is the one you want to target.
And then you can use MoveWindow() (look this up) to put the window where you want it to. (I had to use ::, like ::MoveWindow(). You may have to, too.) If you want, you could put some of these statements into a loop, so it will loop until the program starts and it is put to where you want it. If you need to, you can use GetWindowRect() to see if the window you are checking is already in the right place. Many places you can go from here.
Hope this helps.
Yesterday is history,
Tomorrow is a mystery,
Today is a gift,
That's why they call it the Present.
Danny
|
|
|
|
|
caykahve wrote:
1. to start the program i have tried this function, but it crashes
You want to use "CreateProcess", to start another program.
caykahve wrote:
2. what function can i use to get the path of the program files "C:\program files"? There is a function called "GetWindowsDirectory", but could not find one for program files.
Why do you need a function to find "C:\Program Files"? Program files is on the C:\ drive, according to what you are asking. It is, however possible to have program files on different drives. If it's that you want to know where the program is running from, well then you can use GetModuleFileName.
caykahve wrote:
3. after running the application, i am thinking of capturing it with a hook to set the focus on it, to move and change the size of it. is it right? is there a simpler solution? it won't not only internet explorer that needs to be started. i might need to start another program on some other user event.
Also since you started the program with create process you now have a handle to it. So you can call SetWindowPos to set the window were ever you want.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Hi Friends
I want to get the screen height and widht at run time, so that I can maximize my form size.
Is there any function or any idea how to get screen width and scree height at given resolution ?
Regards,
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
Use GetSystemMetrics() .
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
You can also use ::GetDesktopWindow() to get the handle of the desktop and then ::GetWindowRect() to get the size of the desktop.
Danny
|
|
|
|