|
Hello All ,
I want to make code in VC++ which will usefull,when some application like IE browser,mozilla .... That will run in mininum user access rights .please tell me which api are usefull for me and any extra from you .
Thank You.
|
|
|
|
|
CreateProcessWithLogonW Function[^]
CreateProcessAsUser() windowstations and desktops[^]
You can also accomplish the same thing without writing code. I run my internet browsers under a limited account by using the runas application[^] which allows a process to be created under an account with restrictive permissions.
Here is how I do it here in my office:
1.) I create a very limited user which has very restricted rights, perhaps I name the account 'LimitedUserName'.
2.) Create a shortcut to Internet Explorer or your favorite insecure application.
3.) Right click the shortcut and in the edit box labeled Target add:
C:\WINDOWS\system32\runas.exe /user:LimitedUserName /SaveCred "c:\Program Files\Internet Explorer\iexplore.exe"
Now Internet explorer will run as the user 'LimitedUserName' and may be less vunerable to exploits depending on your local user and security policies.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi There.
Lets say, I have an exe. that sends a user defined message to my console based application on the basis of the title.
Now, I have to recieve that message in my Win32 Console based application. Just FYI, MFC support is enabled in this application.
Please provide your kind suggestions/pointers, so that I can proceed.
Thanks.
PanB
|
|
|
|
|
I can very easily do this by implementing WindowProc(UINT message, WPARAM wParam, LPARAM lParam) function, if the application is Dialog based or MFC Doc View based application.
Another question: Can we implement WindowProc(...) in Win32 Console based application?
Thanks
PanB
|
|
|
|
|
Console applications don't have message loops.
You could however create a Window from a console application.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Not able to get you... I Mean, you said "You could however create a Window from a console application". Is that a solution to recieve User defined messages in Console application. If YES, then please provide pointers to impelment the same. Thanks.
|
|
|
|
|
Do a CreateWindow from the console application. Now you have to have a WindowProc for the new window.
OR
You can create a thread in the console application that waits on a named event.
From the other EXE you can then set the event.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Sorry Buddy. I am not very good at this.
Let me share the full scenerio with you.
There is an application let's say SENDER that will send a user defined message.
We have another application RECIEVER, a Win32 Console application, that needs to recieve that message and on the basis of that message need to do some processing.
Now, as per your suggestion, lets say I have Created a window using CreateWindow API. After this what should I do OR what am I suppose to do?
In case you need any further information from my side, then please let me know. Thanks.
|
|
|
|
|
I recommend the event mechanism rather than sending messages.
Do this in the RECEIVER in a separate thread if needed.
HANDLE hEvent = CreateEvent(0, 0, 0, "MYMESSAGE");
WaitForSingleObject(hEvent, INFINITE);
Do this in the SENDER
HANDLE hEvent = CreateEvent(0, 0, 0, "MYMESSAGE");
SetEvent(hEvent);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
|
Thanks for your help Paresh.
I know, how to send and recieve user defined messages in VC++ MFC based applications i.e., Dialog based/Doc View based application.
My main problem is to recieve user defined message in Win32 console based application. Though sending messages is not a problem. Problem is only to recieve the same.
Thanks
|
|
|
|
|
Did you mean, your console base application is running and you want to communicate to that application ?
Are you looking for something like IPC ?
If Yes, Please refer more information on IPC at here[^].
Regards,
Paresh.
|
|
|
|
|
Hi All,
Is there a way we can startup the GDI+ 1.1 version?
If so what changes are required to use GDI+ 1.1?
Thanx.
Do your Duty and Don't expect the Result
|
|
|
|
|
|
Hi Iain,
Thanx for the info.
Actually i have to develope a simple photo editing tool. so i was looking for the APIs in GDI+ and i found some of them interesting, unfortunatly they are of version 1.1
Do your Duty and Don't expect the Result
|
|
|
|
|
I have made a GDI+ 1.1 Library up in C#, it even includes full legacy emulation (albeit a bit slower than the using GPU like the GDI+ 1.1 does) for when the client machine is windows XP, you can find it here with full source:
http://csharpgdiplus11.codeplex.com/[^]
|
|
|
|
|
I'm sure that's very clever stuff, but I suspect the person who asked the question will be even more interested than me.
(Well done though!)
Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
|
|
|
|
|
Hello Friends
I m converting a .AVI file to .MOV file but after conversion I hv to delete the .AVI file but it is not deleteing.
May b its b'coz of Access (means that AVI file is in use),
b'coz i used DeleteFile,remove,_unlink,system().
Please Suggest me some solution.
Regards & Thanks
Yogesh
|
|
|
|
|
If you are using Windows APIs to open the AVI file, there are 2 possibilities.
You can either use the FILE_FLAG_DELETE_ON_CLOSE flag with CreateFile , or use DeleteFile to delete the file after use. In both cases, the file has to be first closed using CloseHandle .
If you are using a third party conversion library, it will have some similar function to close the source file or delete it after close.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I m using ConvertFileToMovieFile(&FSSource,
FDestName,
FOUR_CHAR_CODE('TVOD'),
smSystemScript,
NULL,
myFlags,
NULL,
NULL,
0L);
and myFlags = createMovieFileDeleteCurFile | showUserSettingsDialog | movieFileSpecValid | movieToFileOnlyExport;
.
|
|
|
|
|
yogeshs wrote: May b its b'coz of Access (means that AVI file is in use),
It's really bad. If you had not mentioned this one you could be spared. You know the reason why you are not able to delete it , but are you asking the same question again? No matter what delete function you use, DeleteFile, BombFile, NukeFile, nothing will work until you close() your file. Just close it after you are done with your conversion. There's no other reason why it cannot be deleted.
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy.
|
|
|
|
|
I m using closeMovieFile(refnum),but still it is not deleting.
|
|
|
|
|
Hi Everybody,
I need a help regarding subclassing CRichEditCtrl....
I have create the class MyRichEditCtrl using base class as CRichEditCtrl. I want to override "SetSelectionCharFormat" function in my subclass. It has to do the same functionality as the base class function + more. Pls any one help.
vijay
modified on Wednesday, April 8, 2009 11:36 PM
|
|
|
|
|
BOOL MyRichEditCtrl::SetSelectionCharFormat(CHARFORMAT2& cf)
{
CRichEditCtrl::SetSelectionCharFormat(cf);
+ more
}
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I would like to select Window objects (Start, File, Close, Minimize, Maximize ...) as a real mouse, however I don't have a real mouse, but I can use my capture coordinate to move the mouse as the following:
SetCapture();
SetCursorPos(pos_X, pos_Y);
ReleaseCapture();
By any chance, when my pointer (pos_X, pos_Y) pointing at a Window object, can I invoke any command, event to do as Left/Right-Click like the real Left/Right mouse buttons?
Many thanks for any help.
|
|
|
|