|
If you want to use a blank instead of the password, you can print what you need to as far as telling the user to enter a password, then set the text color to the same color as the background color. When the user enters the password and presses enter, you can set the text color to what it was before.
This way, when the user enters the password, nothing will be seen.
<br />
int main(void)<br />
{<br />
char password[10];<br />
printf("Enter password...\n");<br />
SetTextColorToSameAsBackground();<br />
gets(password);<br />
SetTextColorToWhatItWasBefore();<br />
return 0;<br />
}<br />
|
|
|
|
|
Hi,
is this possible? I know how to enumerate the local IP adresses, however I am missing the netmask... and googled here and there, but couldn't find an answer. Thanks for help.
|
|
|
|
|
See if this article helps.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I am sure it does! thanks, I will rate for it it later.
(strange again i am not logged in)
|
|
|
|
|
Hi all,
I am looking for code/articles that can show me how to implement bandwidth throttling on a local machine using C/C++. The reason being is that I have users on Satellite Internet that if trying to download more than 160+ megabytes upon reaching the 160 megabyte limit before 24 hours get throttled down to a 10K connection and everything dies. They have requested I write a tool that will allow them to set a bandwidth level on their connection that will keep them under 159 megabytes per 24 hours. Any help would be great.
Thanks,
Rex Winn
|
|
|
|
|
You could write your own application proxy. I would suggest that you get the source code for SOCKS (firewall proxy software) and modify it. Mostly because it's a proxy standard which most internet tools can use.
Then you add your throttling code inside the proxy. It will not be exact throttling though, as you will not be operating on TCP-level. You will never be able to throttle the data which is in your receiving TCP buffer, the sender's TCP buffer and what's currently in air. I don't know how much data that is, but it's at most a megabyte I'd imagine (probably much less).
--
Gott weiß ich will kein Engel sein.
|
|
|
|
|
Jorgen, (Up The IRONS!!!)
SOCKS PROXY EH? You gotta a link or do I have to call the clickety police? I'll go google it but if you have one of the top of you head that would be great.
On your second paragraph, I am interpreting a solution to that to mean that if the limit is 159 megabytes then I better throttle to less than 158 and probably 155 would be safe? Is that how I should interpret that?
Thanks,
Rex
"Back to school, back to school; to prove to dad I'm not a fool." - Billy Madison (Adam Sandler)
Rex Winn
|
|
|
|
|
Code Frog wrote:
Up The IRONS
Oi!
You're in luck: I found this: http://www.naughter.com/sockssvc.html[^]
Code Frog wrote:
On your second paragraph, I am interpreting a solution to that to mean that if the limit is 159 megabytes then I better throttle to less than 158 and probably 155 would be safe? Is that how I should interpret that?
Yep. I might be totally off the scale though regarding how large the TCP buffers are. I imagine the data on the server is accounted for when it's passed through write() rather than when it's actually been TCP-acknowledged by the receiving end. That's why one may have to take the server buffers into account. Is there a technician who you could ask about this?
--
Gott weiß ich will kein Engel sein.
|
|
|
|
|
Rather than ask a technician I bet I can get a better number by experimentation. I don't want to slam a business but the place I would call to ask... I really think that they don't have a clue and they WILL NOT forward me to their engineers... been down that road. It was like going "From here to eternity." but hey "...it's not a bad place" they just don't know anything.
- Rex
Off to go browse that link... This is going to be fun!!! I'm looking forward to this one!!!
"Back to school, back to school; to prove to dad I'm not a fool." - Billy Madison (Adam Sandler)
Rex Winn
|
|
|
|
|
I am trying to make a function that is called every time the mouse is moved (using MFC).
I have this in the dialog header file right before the MESSAGE_MAP is called:
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
In the MESSAGE_MAP I have:
ON_WM_MOUSEMOVE()
My function looks like this:
afx_msg void CBattleBot3Dlg::OnMouseMove(UINT nFlags, CPoint point)
{
//stuff here
}
The function is only called when my mouse is moved INSIDE the dialog box. When the mouse is outside of the dialog box, the function is not called. Anyone have any idea why? Any help is appreciated.
-Dev578
|
|
|
|
|
Call SetCapture() to receive WM_MOUSEMOVE messages when the mouse is outside your dialog. Be sure to ReleaseCapture() when you're no longer interested in receiving these messages when the mouse is outside your dialog.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Anyone have any idea why? Any help is appreciated.
Because that's how WM_MOUSEMOVE works - it's send to the window under the cursor when the mouse is not captured. As Ravi said, you have to capture the mouse to get notified regardless of where the cursor is. You can't do that all the time though, as capturing the mouse means that no other windows will get mouse messages.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber | RightClick-Encrypt
|
|
|
|
|
BYTE ks[256];
GetKeyboardState(ks);
WORD w;
UINT scan;
scan=0;
ToAscii(wParam,scan,ks,&w,0);
ch =char(w);
MessageBox(0,"" + ch,"Key pressed",MB_OK); // <-- is this the right way of getting the char into a string? The results are jumbled
|
|
|
|
|
please buy a book about C++ and windows programming
|
|
|
|
|
Anonymous wrote:
windows programming
This really is not windows programming (except for the MessageBox). I mean a windows programmer will never do this (reading keyboard codes...). Windows programming is event driven. The proper way to handle the keyboard is through events and accelerators that fire events (i.e. assign ALT-A to send the ID_USER_COMMAND command message)
John
|
|
|
|
|
Hi all;
I am creating an application which will have a login dialog. In the dialog, i have a "close" button which is supposed to close the WHOLE application. Can somebody please help me in getting this done.
Thanks
Nb. Could you please help me to understand have i can gray out menu's and toolbars prior to login on the application
Visual Beginner
|
|
|
|
|
In the handler for your dialog's "Close" button, do the following:
AfxGetMainWnd()->PostMessage (WM_CLOSE);
CDialog::OnOK();
This should cause the dialog to close and the app to properly exit.
Your app's menu items can be (selectively) grayed out (i.e. disabled) by implementing UI update handlers for them. You can write a single handler that enables the menu item only if the login phase has successfully completed.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
class MyWinApp : public CWinApp {
virtual BOOL InitInstance();
}
BOOL MyWinApp::InitInstance()
{
MyLoginDialog dlg;
if ( IDOK == dlg.DoModal() ) {
}
else {
return FALSE;
}
return TRUE;
}
this might be one way ot handle it
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
All,
I posted a description of this problem on the following board, which the source code was available from:
http://www.codeproject.com/system/serial.asp
Because there is so much more activity on this board I thought I would also post a link to it here. Anyone familiar with the CSerialWnd class might be able to offer me some advice.
Thanks,
Robert
|
|
|
|
|
This article here:
http://www.codeproject.com/dialog/scrollablechilddialog.asp
is really cool, but it's for a CDialog. I am trying to
re-write it for a CFormView. The section of code here:
CRect rc;
GetDlgItem(IDC_PLACEHOLDER)->GetWindowRect(rc);
ScreenToClient(&rc);
m_pdlgScroll->MoveWindow(rc);
I have a CFormView with the resource IDD_FORM1. How
can I rewrite this section of code properly? I can't
have:
GetDlgItem(IDD_FORM1)->GetWindowRect(rc);
?????
|
|
|
|
|
I have been working on a project that retrieves various credit reports from the 3 credit bureaus. I have been trying to retrieve the certificate that I am getting back when connecting to the bureau so that I may verify the certificate. All the examples I have found in the Microsoft documentation show me how to retrieve the info from my local machine but not from the server.
I found information on winhttp and downloaded the latest Platform SDK to utilize it. I created a class to use winhttp to get the certificate back and verify it. The class compiles fine, but when I compile the complete application I get LNK2001 ConvertStringToBSTR errors. When I uninstall the SDK I can compile the application again without using the new class.
I am using Visual Studio .NET (not 2003).
Might anyone know how to get around this or a way I can accomplish the same thing without using winhttp?
|
|
|
|
|
|
I saw comsupp.lib as well, but I still get the same LNK errors linking with comsupp.lib.
I guess I will keep looking for alternatives. Thank you for your input.
|
|
|
|
|
I’m Visual C++ newbie trying to make a Win-32 class that create a hover button (without MFC).
I trying to use the mellertson's article "How to use SetTimer() with callback to a non-static member function" to substitute button’s WNDPROC, so it can process it's own WM_MOUSEOVER, WM_MOUSEHOVER, WM_MOUSELEAVE messages.
I use all the technique shown in the article, and work fine, but only with one control. If I create two o more controls, pObject always refers to the last control created.
Anybody knows how to call a callback function within it's own class?
Please help me.
|
|
|
|
|
The most easiest approach to this problem is not by following Mellertson's article.
Like you stated, you are creating a class that manages a custom button control. What you are doing, infact, is much similar to MFC: a wrapper class for a Win32 API routine. MFC, although, implements everything based on the window-thinking: every control is derived from CWnd.
Instead of using Mellertson's article, consider the following approach:
1. In your program, create a new instance of the class. When this instance is created, all member functions and variables of the class become valid.
2. Call a 'second-phase' constructor that creates the actual Windows button control. As all member functions are properly initialized in step 1, you can refer to a non-static member function to handle the WNDPROC's job.
This approach allows each instance of the button class to function independently, ESPECIALLY if you use dynamic creation of the objects. Just remember that the clean-up work must be implemented very carefully to avoid memory leaks.
In the 'second-phase' constructor, you can use the Win32 API routines to create the button control, and the returned HWND to replace the window procedure function.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|