|
Hi,
What messages do I need to use (if this is the way) to set the position and size of dialog controls if I am not using MFC.
Thanks in advance
Zak
|
|
|
|
|
SetWindowPos() and/or MoveWindow()
--Mike--
"I'm working really, really fast at the moment, so a 3 minute outage becomes, due to time dilation, a 5 minute outage."
-- Chris Manuder, relativistic system administrator
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
Suppose I have a dll containing the implementation of a logging tool.
I also have another dll containing the implementation of an exception class.
Now, I would like any external object INCLUDING an instance of the logging tool to be to throw exceptions using my excpetion class.
I also want the Exception class to log every exception thrown into a log file.
So, the dilemma is two dlls that depened on each other.
Obviously, there are many hackish way of getting around this, but is there a standard and eloquent way of dealing with a situation like this?
|
|
|
|
|
I am in desperate need of being able to increase the height of my statusbar in an Doc/View MFC application. I need to owner draw the whole thing as well, but I don't think that is much of a problem. I tried looking into code like CSizingControlBar but I wasn't able to figure out what is relevant and what is not as it is extremely complicated. I would have never thought that something that should be as trivial as resizing a statusbar would be so difficult.
Cheers,
Clint
|
|
|
|
|
m_wndStatusBar.GetStatusBarCtrl().SetMinHeight(nMinimumHeight) in CMainFrame::OnCreate() after the status bar has been created.
Hope this helps,
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"
|
|
|
|
|
How can I set the key states that GetAsyncKeyState() returns?
SetKeyboardState only sets the ones that the other keyboard functions return, but GetAsyncKeyState() is global it seems.
|
|
|
|
|
Hello all,
I want to develop a piece of software in VC++, but I have some questions as Iam a *very* unexperienced VC++ user..
The program has the following requirements :
The software should be able to run in all Windows versions.
When first running the setup, the software must ask me to enter an x number of days.
When windows starts up, it must run in background (as a service), meaning it may not be visible for users nor tracable.
Every time windows starts up, the program should check if the number of days initially configured has not already passed.
If not, nothing should happen.
If the time has expired, the program should ask for a password.. As long as the password is entered incorrectly, Windows access should be blocked (by means of a password popup loop or maybe better, a restart of windows every couple of time the password is entered incorrectly)
If the password is entered correctly, nothing should happen , the program keeps running in the background or uninstalls itself)
It must be relatively secure, meaning a user should not be able to stop running the program..(with the windows taskmanager for example)
My questions are now :
Is this easy to implement using C++ ?
Do you have some tips to share ?
I am basically a web developer, but I have some experience in C++ (unfortunately the borland version) and this is a good opportunity to finally learn Visual C++.. (I used it very long time ago)
Many thanks in advance for your answers !!
konac
Wife : " Sometimes I think you are more attached to that PC than to your wife !"
Me : "That's not true. Iam not attached more to 'this' computer than to you dear."
Wife : "to 'that' computer ???"
Me (thinking): (..please don't start talking about my laptop..)
|
|
|
|
|
konac wrote:
Is this easy to implement using C++ ?
Since you are experienced in programing this should be fairly easy for you, except the part where you would want this program to run as a service. Do you have any experience in that?
konac wrote:
The software should be able to run in all Windows versions.
That depends on what you're trying to build and what kind of functions you will be calling. In general most programs will run in all Windows versions but you should always check the functions that you are using. They always tell you the platforms where they can run. Also from my experience in using ADO 2.7, I found out that I can't install MDAC 2.7 in windows 95.
konac wrote:
Every time windows starts up, the program should check if the number of days initially configured has not already passed.
You could check out this article [^].
konac wrote:
If the time has expired, the program should ask for a password..
This is not difficult either. You have to encrypt your password and store it in a safe location. Make sure it's a one way encryption and don't provide any decrytion methods in your source code. When the user enters the password, encrypt it, and then compare it against the encrypted stored password. You should be able to find many encryption libraries in the web.
konac wrote:
Windows access should be blocked
I really have no advice on this topic because I am so against blocking the user from logging in just because your program decides to do so. Let Windows handle that. No offense.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Thank you for your reply !
I have no experience with programs that run as services, relatively few information is available on the net regarding this topic ... Does anyone has more information? Or maybe someone knows a good source on the web ?
Thank you !
|
|
|
|
|
Is a WH_CALLWNDPROC global hook not supposed to catch WM_KEYUP/WM_KEYDOWN messages for some reason? I have an edit control hooked, but I can't get these messages. I do get some normal ones (focus, destry, a few edit control ones), so I know it is hooked right :/ Spy++ shows the WM_KEYUP/WM_KEYDOWN messsages fine.
|
|
|
|
|
I have a kind of *unusual* problem:
m_EditBox, and m_strText, where m_strText.GetLength = 10 (for example). Is is possible to set the text in the box so that the first 5 characters display black, while the last 5 display red? I tried this whenever I send ON_EN_CHANGE for the box:
void CTwoColorEdit::OnEditChange()<br />
{<br />
CString text;<br />
m_ctlFirst.GetWindowText( text ); <br />
if ( text.GetLength() > 5 )<br />
m_EditBox.SetTextColor(RED);<br />
else<br />
m_EditBox.SetTextColor(BLACK);<br />
}
The problem of course is that SetTextColor changes the color of the entire string, not just the last entered character...Is there some way of setting the color of the last updated character while leaving the text already in the box as is?
Reistance is futile...
( When < 1 OHM )
|
|
|
|
|
CRichEditCtrl is the solution.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Darn it! Beaten to it
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
"I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.
|
|
|
|
|
but you gave a better answer!
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Instead of a CEdit, use a CRichEditCtrl. Use SetSel to select the characters you want to change and then SetSelectionCharFormat( CHARFORMAT& cf ) to change the formatting of the text you want. By setting the crTextColor attribute of the CHARFORMAT structure, you can change the colour to whatever you want. Check out CRichEditCtrl in MSDN.
hope this helps
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
"I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.
|
|
|
|
|
Thank you much Next time I will dig on msdn a little longer before posting
~Sorcia
|
|
|
|
|
if i have administrative privilages of a machine(have user name and password)
Please give me some idea so that i can write a program to login that machine using username and password.
gautam
|
|
|
|
|
I would like to know how to change the height of a statusbar. Basically I want to make an owner-drawn status bar that is a little bit taller than the default MFC one.
Cheers,
Clint
|
|
|
|
|
I am using an SDI application with a splitter window and I want to change the view in one of the panes depending on what menu item is selected (e.g. go from a TreeView to a ListView). It seems to work but when redrawing the whole thing looks like a dog's breakfast. When I resize the splitter it seems to then redraw okay. Any suggestions? Am I not getting the size correct? I also tried Invalidate() for the frame window but it didn't seems to be sucessful either.
...<br />
m_Split2.GetColumnInfo(1,cx,ctemp);<br />
m_Split2.GetRowInfo(0,cy,ctemp);<br />
m_Split2.DeleteView(0,1);<br />
m_Split2.CreateView(0,1,RUNTIME_CLASS(CMyListView),CSize(cx,cy),NULL);<br />
GetActiveDocument()->UpdateAllViews(NULL);<br />
...
Many thanks
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
"I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.
|
|
|
|
|
http://www.codeproject.com/docview/switchingviews.asp[^] should help
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"
|
|
|
|
|
Ryan,
You de man! Thanks
Adam.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
"I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.
|
|
|
|
|
When I go to reopen my workspace project, I only get "CAboutDlg". The other View,Doc and Frame classes are not there, how do I reopen them as well? When I compile, I get the following message:
Compiling...
Exodus.cpp
StdAfx.cpp
Linking...
Exodus.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CExodusDoc::classCExodusDoc" (?classCExodusDoc@CExodusDoc@@2UCRuntimeClass@@B)
Exodus.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CMainFrame::classCMainFrame" (?classCMainFrame@CMainFrame@@2UCRuntimeClass@@B)
Exodus.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CExodusView::classCExodusView" (?classCExodusView@CExodusView@@2UCRuntimeClass@@B)
Debug/Exodus.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
Exodus.exe - 4 error(s), 0 warning(s)
Thanks
I am using VC++ 6.0.
|
|
|
|
|
My first thought was that you simply needed to delete the project's CLW and NCB files and let Visual Studio rebuild them. However, the linker errors suggest that the files were somehow removed from the project. Have you tried adding them manually?
|
|
|
|
|
Thanks Dave, you were right...I needed to add the files manually. It appears that hardly any of my files opened. What I don't understand is why VC++ doesn't open all the necessary files with the workspace (.dsw) file. It's kind of misleading.
Question: how do I open ALL my project files at once every time I reopen my project. I'm sure you don't have to manually open 2 dozen files every time you want to reopen your program, or do you?
Thanks much, Dave
I'm using VC++ 6.0
|
|
|
|
|
DaveE9th wrote:
I don't understand is why VC++ doesn't open all the necessary files with the workspace (.dsw) file. It's kind of misleading.
Normally it does. But that's not to say that it doesn't occassionally get confused. For a large project I am working on, I have to remove those temporary files at least once per week, sometimes less.
|
|
|
|