|
Which MouseOver effect do you mean? What should happen if the button gets the focus?
|
|
|
|
|
Hi,
In a Hello World MFC Application create a CheckBox Button (with no caption and no caption space) on the main dialog form...
When i move the mouse over the control here it gets an orange (inner) highlight - so you can see that the button is in focus..
This does not happen when you tab into the control by keyboard...
run the application and watch how the checkbox looks different when you move the mouse over it - then try to tab into the checkbox - and you can see that no change occurs...
I owuld like the same effect to be applied to the control when the user tabs into the control as if the user moved the mouse over the controll..
I'm sorry I cant be more specific... I'm kindof a newbie with Visual Studio / MFC...
/Henrik
|
|
|
|
|
Um, Seems to be an XP feature - Saw my code on win2k today - and there there is no mouseover effect.......
Well ... then my problem is not really important anymore as the solution would only work for Xp users......
/Henrik
|
|
|
|
|
Which is better to use
AfxMessageBox
or
CWnd::MessageBox ?
According to the SDK Documentation:
"Use the global function AfxMessageBox instead of this member function to implement a message box in your application.", but with CWnd::MessageBox one can set the caption of the message box.
Anybody got any ideas or comments.
|
|
|
|
|
FranzKlein wrote:
According to the SDK Documentation:
"Use the global function AfxMessageBox instead of this member function to implement a message box in your application.", but with CWnd::MessageBox one can set the caption of the message box.
That is probably the point. AfxMessageBox sets the name of the application in the title, so you can see where the message box is comming from.
|
|
|
|
|
Depends on what you need to display. You can always call ::MessageBox() for complete control, or use the MFC class members to hide away the details of hwnds, etc. as the situation requires.
<marquee scrollamount="3" scrolldelay="80" direction="right" width="40%" style="border: 2px inset silver;background-color:yellow;color:green;font-family:Verdana,Arial;font-size:8pt;font-style:italic">onwards and upwards...
|
|
|
|
|
I really don't know where else to ask this question but it is more a Windows Installer related question.
I built a simple program with VC6 (that's why in the subject I put not very VC++ related, b/c it is only 0.0000001% related) and I want to give it to someone who is not into computers. To make his job easier I built an installation file using windows installer. Even though, this is the very first time I used windows installer everything works fine. When I run the program from its shortcut in the START->PROGRAMS->MYAPP menu, it won't find the files that the program uses for input/output. The files are there and I know this has something to do with the shortcut, but I really don't know how to fix it. I ran into this problem 2 years ago and I don't remember how I fixed it. The thing is that right now I am pressed for time because I need to send this the day after tomorrow.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Use Innosetup (you can downlaod it for free). In about 10 minutes, you should have your installation file settled up with file extensions registration and shortcuts taht are working fine.
~RaGE();
|
|
|
|
|
I have the shortcuts and the program runs just fine up to the point where it has to read a file which is located in the applications directory. I think my problem has to do with some registry settings because when a program runs from a shortcut something tells me that it considers as the running directory the shortcut's directory. I really don't have a problem with building the installation file.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
OK. Then I would suggest to do the following (MFC):
use GetCommandLine() to retrieve your .exe path (Parse the string for that)
use SetCurrentDirectory to set the .. current directory to the one you have found out.
This should solve the problem.
~RaGE();
|
|
|
|
|
Rage wrote:
This should solve the problem.
Until the user opens a file that is not in that directory, and the File Open dialog box changes the current directory.
A more robust way is to get the exe path with GetCommandLine() like you said, and then open the data files from that directory, rather than relying on the current directory, which the user can change at any time.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
VSI is not particularly good for creating shortcuts. I got around this by coding my program so that it found out what directory the main exe file was in, and then looked for the data files in the same dir. It fixes the symptoms, not the underlying problem, but it does work.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
< TARGETDIR >\*.exe
set the Traget property of ur shortcut(for Exe) if ur usig install shiled for MVC++6.0
hope it'll work for u...
nice time
Adi
|
|
|
|
|
Thank you for your help everyone. I will try your suggestions and I will let you know.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Well Rage and Ryan Binns, your advice was very helpfull and it worked perfectly. Thank you very much. Thank you for your reply Adi, but I am not using InstallShield so I couldn't try your suggestion.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
i create a new single document project with wizard,and the name of the project name is MyProject.after execute the proprame, the caption of the window is
"untitled:1-MyProject"
Now i ask how to remove the sign ":"?
gucy
|
|
|
|
|
You need to override the SetTitle() function member of your CDocument-derived object.
|
|
|
|
|
i did so,but the string ":1" is still there
|
|
|
|
|
hello......
u can set the title of the application window in InitInstance() function of the SDI application class....
u'll have m_pMainWnd as member variable... all u've to do is
m_pMainWnd->SetWindowText("MyProject");
or go to string table and change IDS_APP_TITLE Caption to Myproject......
try the first one...which is better
Adi
|
|
|
|
|
This is strange, as a default SDI, or even an MDI, application would have a caption of Untitled - MyProject. It sounds like you've changed something to get the additional ":1" in the caption.
Now to get rid of the "Untitled - " part of the caption, simply add the following to your CMainFrame::PreCreateWindow() function:
cs.style &= ~FWS_ADDTOTITLE;
|
|
|
|
|
The :1 indicates the view number of of the document is open in the current session (MDI-related).
For more details, look at the MFC source code file WINFRM.CPP, function
void CFrameWnd::UpdateFrameTitleForDocument(LPCTSTR lpszDocName)
<marquee scrollamount="3" scrolldelay="80" direction="right" width="40%" style="border: 2px inset silver;background-color:yellow;color:green;font-family:Verdana,Arial;font-size:8pt;font-style:italic">onwards and upwards...
|
|
|
|
|
I knew I'd seen the :1 before but since I've probably only written 3 MDI apps since they were introduced, I couldn't pull it from memory. Even so, I've not ever needed to open two of the same window! Most of what I do revolves around dialog boxes, and SDI apps, or no UI at all.
|
|
|
|
|
Hi !
I have a Handle on a process for which I'd like to change the priority. For this, I use the SetPriorityClass, but it fails, and it seems (with a GetLastError) that my aplication doesn't have the rights to change the priority of the process. (I'm running it on WinNT)
Anyone knows how I could change the priority ?
Thank s for your help!
Jérôme
|
|
|
|
|
You need to use AdjustTokenPrivileges() to enable the PROCESS_SET_INFORMATION access right. There are a few examples of how to do this in the docs.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
hey,
We want to synchronize a memory area with a file on disk.
I did the following steps:
- CreateFile(...,CREATE_ALWAYS)
- CreateFileMapping(FileHandle)
- pdata* <= MapViewOfFile(MapHandle)
then I use memcpy to write data to the file.
When I write a buffer to pData that is larger then the filesize, the buffer is truncated to the file size.
So I want the file to grow dynamically in size.
There is an api func DeviceIoControl with param FSCTL_SET_SPARSE to accomplish this, but this only seems to work on win 2000 with NTFS 5.
Anyone has an idea to accomplish this behaviour?
Thanks in advance.
|
|
|
|