|
mkoroudjiev wrote: The problem is that it will always return FALSE when running on Vista
It will return TRUE if the process is running on Vista AS an administrator.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
OK, this is obvious. But how to find whether an account is standard or administrator's if the user is running the app with non elevated privileges?
Martin
|
|
|
|
|
mkoroudjiev wrote: this is obvious
Not when your topic is "How to check if running under administrator account on Vista".
From the context of your app, it doesn't matter - if the app isn't running
elevated then even if an administrator is the invoker of the app, there's still
no administrative privileges for the app.
Checking if a user is a member of an administrator group is a different thing.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I understand your point. Any suggestions on how to check if a user is a member of an administrator group?
Thanks.
|
|
|
|
|
|
Hi All
How can i get installation path of application?
|
|
|
|
|
Well it all depends on the approach a developer takes.
Do you want to acquire the installation path of your application itself?
If yes, than you should have the source code and you must be writing it somewhere in the registry (ideally) or to some text file during the installation. You can read it from either of the places.
If it's the installation path of a third party application, that you need than you need to know before hand where they are writing it.
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
You can use GetModuleFileName to get the full path to your application.
Good luck.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Do you want to get the path of an installed application which is listed in the Add/Remove programs?
If yes, then,
Windows keep the un-installation information under this registry key - HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall . Under this key for each item there will be DisplayName subkey, which holds the name of application and InstallLocation subkey, which holds the path of the installed application.
Refer this article[^] about how to iterate through the registry uninstall information and get those values.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
I am using the listview in record view mode . Now I have selected the Listview row and it becomes blue . Now I want to remove the selection of this row without clicking on the list view . I want to write code on button click . is there any message to send to listview to diselect the row .
Ashish
|
|
|
|
|
See SetItemState & SetSelectionMark
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
not doing anything that I need . i.e. not diselecting the row
Ashish
|
|
|
|
|
How are you using them? Can you post some code...
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I select the listview row it get highlighted with blue color. Now what I want ,I want diselected the row i.e. not highlighted the row without clicking on the listview i.e. from button . for that I write the following code on the button click
ListView_SetSelectionMark(GetDlgItem(hDlg,IDC_LIST1),-1);
but nothing happen list view row is still selected.
Ashish
|
|
|
|
|
int i = m_list.GetSelectionMark();
ListView_SetItemState(m_list.GetSafeHwnd(),-1,LVIS_DROPHILITED,LVIS_STATEIMAGEMASK );
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
still not working . I could not where you are using i;
Ashish
|
|
|
|
|
you won't need to use i. The snippet was from a previous code and I just forgot to remove the GetSelectionMark() thing from the code before posting it. BTW it does work for me when I use it in ListView. Have you selected the property of always showing a selected item whatever the case may be. ie the user click out of the list view or otherwise
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
your code is still not working
ListView_SetItemState(GetDlgItem(hDlg,IDC_LIST1),-1,LVIS_DROPHILITED,LVIS_STATEIMAGEMASK );
Ashish
|
|
|
|
|
Hi,
I am working on a project and require the button coordinates of office applications. e.g. open, save etc. I am not interested in what the buttons do I just need to know where they are. The main toolbars are what I am really interested in. If anyone has any examples or can point me in the right direction that would be much appreciated.
Thanks
|
|
|
|
|
i want to fire leave event of a textbox when it's max length is exceeded , how can i call the event
|
|
|
|
|
prasadbuddhika wrote: how can i call the event
You may call it 'MaxLengthExceededEvent '
Warning: humorless people!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Monday, November 24, 2008 4:09 PM
|
|
|
|
|
Check out the EN_MAXTEXT notification, maybe it's what you need.
|
|
|
|
|
Hi,
I am calling this function, from my MFC app in VS 2005.
ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, NULL, NULL);
If this call is made, printer selection dialog opens, if i select a printer and click ok, printing starts and everything works fine.
However, there is case, if the printer dialog is open and I do not click on ok and wait for a few seconds (say more than 10 sec), a server busy dialog shows up.
Server Busy
This action cannot be completed because the other program is busy. Chose
'Switch To' to activate the busy program and correct the problem.
But 'Switch To' activates the Start menu, and there is no way to make the
Server Busy error to go away except by killing my program altogether, and
then deleting the print task from the task list.
And i do not want to use, OLECMDEXECOPT_DONTPROMPTUSER for the second param.
Any suggestions please....
Thanks in Advance.
Saleem
|
|
|
|
|
What happens to the "server busy dialog" when you click OK on the print dialog ?
|
|
|
|
|
Nope, you cannot do anything with the app once the server busy dialog comes.
You have to kill the app from the task manager, and also the print window has to be killed.
|
|
|
|