|
It's not hidden. It doesn't exist. (at least officially)
Try out http://www.codeproject.com/tools/vsrename.asp
|
|
|
|
|
Copy the .dsp and .dsw to another place. Rename them. Open them in a text editor (such as MSVC itself - but open them as text!). Replace appropriate sections.
Some might say "Why in the name of ... is this so complicated". It's not, it's the way of Microsoft: Whenever you can make something undocumented: Make it so!
|
|
|
|
|
Hi
I try to launch the screensaver with password protection. I tried this code:
SendMessage(GetDesktopWindow(),WM_SYSCOMMAND,SC_SCREENSAVE,0);
but this starts the screensaver without password protection.
Therefore I wrote my own function to call a screensaver and protect the workstation:
#include "stdafx.h"
#include <stdio.h>
#include <shellapi.h>
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
{
char WinDir[256], ScrDir[256], RunDir[256];
GetWindowsDirectory(WinDir,sizeof(WinDir));
sprintf(ScrDir,"%s\\System32\\sstext3d.scr",WinDir);
sprintf(RunDir,"%s\\System32\\rundll32.exe",WinDir);
SHELLEXECUTEINFO sei = { 0 };
sei.cbSize = sizeof( sei );
sei.lpVerb = "open";
sei.lpFile = ScrDir;
sei.nShow = SW_SHOWNORMAL;
sei.fMask = SEE_MASK_NOCLOSEPROCESS;
if( ShellExecuteEx( &sei ) )
{
WaitForSingleObject( sei.hProcess, INFINITE );
ShellExecute(GetDesktopWindow(),"open",RunDir,"user32.dll,LockWorkStation","",SW_SHOWNORMAL);
}
return 0;
}
It first launches the screensaver via ShellExecuteEx and then waits until it's finished. (WaitForSingleObject). Right after that, the workstation is being locked using a Rundll code.
But how safe is this code? Will the user still be able to bypass the lock or is my code safe enough?
reagrds
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
*Puts paranoia level security hat on*
What guarantee do you have that between
<br />
WaitForSingleObject( sei.hProcess, INFINITE );<br />
and
<br />
ShellExecute(GetDesktopWindow(),"open",RunDir,"user32.dll,LockWorkStation","",SW_SHOWNORMAL);<br />
Nothing else gets a chance to run?
|
|
|
|
|
But how safe is this code?
Not especially safe.
Right after that, the workstation is being locked using a Rundll code.
And that "code" would be... 42? 4711?
Will the user still be able to bypass the lock or is my code safe enough?
In order: "Yes" and "No way".
Isn't there a semi-documented RunDll32.dll entry point to start the screensaver?
|
|
|
|
|
i have a list box and a text field....
if the user select an element in the list box, the CString of the selected element should go to the text field...
i think it can be made by the " SendDlgItemMessage(IDC_SAVENAME,...."
but i don't know the uint message for doing this.
can someone help???
i use vs 6.0....
thanx a lot and have a nice weekend!
tom.
|
|
|
|
|
Are the list box and the edit box in the same window?
|
|
|
|
|
Hi all, I have a couple of quick questions that I really need an answer to.
1.) I have the following code:
try
{
//reads in info from file
}
catch(ifstream::failure)
{
//deals with error
}
How do I MANUALLY throw an exception so it is caught by this code (I don't want to wait for the failbit to be set).
2.) Why does my DirecDraw primary surface back buffer throw up multi-coloured junk when I flip to it using a high resolution and 32 bit display? If I write to this "junk" on the surface, exit the app, delete the code that writes to the surface and then restart the app, the junk is displayed as it was before, even though I haven't written to it (seems like it is accessing same area of memory for back buffer???). The initial surface is fine (plain black) and can be written to and flipped to fine, but the back buffer can't. I don't get any problems using 16 bit display at any res. The code I used is straight out of the DirectDraw SDK docs. I'm just wondering if anyone had the same problem and how they resolved it?
Obviously I'd appreciate a full answer to the questions, but any ideas or links to web pages that may answer them would be just as brilliant.
Alan.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
|
hehe, but what parameter do I pass to throw? throw (ifstream::failure) doesn't work, throw (ifstream::failbit) neither and, obviously, neither does throw - where an unhandled exception occurs. Any other bright ideas clever cloggs ?
Alan.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
throw (ifstream::failure) doesn't work
That's expected. First you used a syntax that isn't anywhere close C++, then you tried to throw an exception of a class that needs an argument. You might try
throw ifstream::failure("foo");
But I'd say you've got a design error if you want to throw an exception on behalf of someone else like this. Your code is then basically lying (even if it's you that catches that same execption).
Step back a second and think: Would you want to maintain that code in two, five or ten years from now?
If you're interested in failures, not just the ones that throw "ios_base<...>::failure", why not catch "exception" (as "const std::exception&" of course).
Why does my DirecDraw primary surface back buffer throw up multi-coloured junk when I flip to it using a high resolution and 32 bit display?
Because you haven't painted into the back-buffer! Check the return values of every call to DirectDraw.
|
|
|
|
|
I'd need some more info or advice. Here's the problem: I need to take a
file, the file may be any file, opened with something like a Browse button, and
to encrypt it, then send it to a specific address, the addres on the net is
also given by me, and there, if the file arrives safe at the address I wanted,
it will be decrypted and can be read by the receiver. I have some code, but I
have to use the sockets programming stuff, and to know the specific port also,
so that , if I would like, the program may run on the same machine as well,
just sending and receiving at the same port.
And all this prg I have to make in Visual C++, what I have is VC++ 6.
thanks,
steve
|
|
|
|
|
I don't understand your problem but sending and receiving on one local computer normally works with an 127.x.x.x IP address (127.0.0.1).
|
|
|
|
|
not sure what your exact difficulty is but it seems like you need help with the internet transmission end of the app----try finding on MSDN site the section entitled "Internet Programming With WinINet", it's a good place to start....if you are using MFC you can get alot of free functionality with the MFC wrappers for the wininet stuff....
good luck
1. The Lord loves a workin' man.
2. See a doctor and get rid of it.
3. Don't trust whitey.
|
|
|
|
|
int CFlowChartView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CScrollView::OnCreate(lpCreateStruct) == -1)
return -1;
SetScrollSizes(MM_TEXT, CSize(1000, 1000));
ScrollToPosition(CPoint(500, 500));
return 0;
} This is my OnCreate handler in a CScrollView. First I set the scroll size, and I want the scrolls to start off in the middle. But for some reason nothing happens when I call ScrollToPosition. Does anyone know why this happens, and a possible solution...
Thanks for your time!
With time we live, with money we spend!
Joel Holdsworth
|
|
|
|
|
you need to put the scrollto code in OnInitialUpdate to see some results, you will need to then add code to the OnUpdate as well to scroll....also this code will not position the scrollbars in the middle of the scroll track---this code scroll the logical document point (500,500) to the upper lefthand corner of the client window-----the thumbtrack pos will be dependent on the window size( window state == normalized, maximized, etc and that relation to the scroll pos) , sorry, it's not as simple as falling out of your chair!!!
1. The Lord loves a workin' man.
2. See a doctor and get rid of it.
3. Don't trust whitey.
|
|
|
|
|
Can anyone tell me where the Address Book is stored? Is it stored as a file? Or in the registry? Is it stored just on a per user basis? Or is it stored on a per user per OE-identity basis?
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
|
|
|
|
|
|
Search for *.wab files. For NT it should be stored in -
C:\Documents and Settings\USER_NAME\Application Data\Microsoft\Address Book as a .wab file.
HTH,
- Manish
|
|
|
|
|
|
For some reason I cant add member variables to items in dialogs, either via the context menu or CTRL and double clicking. If I add say a radio button to the About Dialog it works there, but CTRL + double clicking on a control in a user defined form just brings up the add class dialog.
Any help appreciated
|
|
|
|
|
I want to convert modal dialog to modeless dialog box.Can I? the dialog box is already created and I want this conversion at run time.
VIKS
|
|
|
|
|
|
hi,
Here the issue is not like this I don't have code for dialog box and I am converting it to modal or modeless dialog box.I am in different process. I have dialog window handle of some other application of different process. and I want this conversion.
VIKS
|
|
|
|
|
vikrams wrote:
I have dialog window handle of some other application of different process. and I want this conversion.
Not possible! The modality of a window is not a window style. It's simulated via code. For example, the CDialog::DoModal will disable the parent window till the dialog is dismissed! That's how it gives us a modal feel!
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
|
|
|
|