|
|
Hi All,
In my application I need to execute some commands. For that I am making a .bat file and execute it using Shellexecute(). It is working well for Vista32 bit, but in Vista64 bit machine Shellexecute() is not running these commands(i am running with Admin privileges also). Does ShellExecute() not support Vista64 bit?
Is there any other way for Vista64 bit.
Thanks
Madan
|
|
|
|
|
It's probably some error in your batch file.
First run the batch file manually and check if all the commands work.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks for replying. Yes all the commands are correct because if I run this batch file with command prompt then it execute successfully.
Let me explain- I am running following three commands command1)- bcdedit /set {bootmgr} device boot > D:\m1.txt
command2)- bcdedit /set {default} device boot > D:\m3.txt command3)- bcdedit /set {default} osdevice boot > D\m2.txt.
These three commands clears Bootmgr of Vista.
For runnong these commands I make a batch file and execute it with ShellExecute() For seeing output I used pipe. Then after ShellExecute() if I see these m1,m2,m3 files then these are blank.
I am confused now.
|
|
|
|
|
|
Madan Chauhan wrote: ...but in Vista64 bit machine Shellexecute() is not running these commands(i am running with Admin privileges also).
What does it return?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
How can we get the acrobat path reader exe path in VC++
|
|
|
|
|
Why do you want the path?
Is it so that you can use it to launch a PDF file?
If so, you don't need to know the path.
You can simply use ShellExecute to launch it.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
«_Superman_» wrote: Why do you want the path?
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
DavidCrow wrote: See here.
It's not because of my post Mr. Crow.
I've gave him this answer after I saw his post about the exe path.
I knew that you will give him the right directions about the exe path and decided to show the OP how could he pass cmd line args to Acrobat reader in order to select given page.
Regards
Nuri Ismail
|
|
|
|
|
Hi deadlyabbas,
Did you try searching the Adobe forums[^] before asking in the C++ forum?
Best Wishes,
-David Delaune
|
|
|
|
|
Try
SearchPath[^]
Pass "AcroRd32.exe" as lpFileName to that function.
|
|
|
|
|
Use FindExecutable() .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I am trying to widen drop-down part of combo box but keep fixed size of combo box.
For the same i used following in my code. But drop down portion of the combo box remained as it is.
No change reflected in it's size.
LRESULT OnDropDown(WORD wNCode, WORD wID, HWND hWCtl, BOOL & bH1)
{
::SendMessage(v_ComboBox->v_hWnd, CB_SETDROPPEDWIDTH, 100 , 0);
::SendMessage(v_ComboBox->v_hWnd, CB_SETHORIZONTALEXTENT , 100 , 0);
}
Please help to solve this issue..
|
|
|
|
|
CB_SETDROPPEDWIDTH is used to set the maximum allowable width and not the exact width of the drop down list.
In your case the drop down list will grow up to 100 pixel if you have lengthy strings as its items.
For fixing a large width to the drop down, you may need an owner draw combo box.
This article could be of help - FontComboBox - a font listing combo box for .NET[^]
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
«_Superman_» wrote: In your case the drop down list will grow up to 100 pixel if you have lengthy strings as its items
I guess thats not correct. To confirm I just tried the code and the width of drop down changed to 100( Provided the width of combo is less than 100 pix ).
|
|
|
|
|
Thanks for the information.
Never tried it myself.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks to all for quick response.
Now my problem is solved.
MSDN itself states "Call this function to set the minimum allowable width, in pixels, of the list box of a combo box"
The problem was the very small width specified by me.
The 100 pixel size was less then the width of the combo box itself, that's why i was not able to see any change.
Thank you very much!
|
|
|
|
|
Hello all
I am making a MFC silent application which will trace if windows is shutting down or not and if it is I will have to stp this shut down and perform some other work and then initiate the shutdown myself.I am overriding method to handle WM_QUERYENDSESSION . the code is some thing like this
BOOL CMyShutDownDlg::OnQueryEndSession()
{
ShellExecuteA(NULL, "open","abc.exe", NULL, NULL, SW_SHOWNORMAL);
::MessageBox(NULL,_T("Test"),_T("I stopped shutdown"),MB_OK);
return FALSE;
}
The thing is that returning false allows window to halt the sutdown but not completely stop it. Also,while trying to file any other exe at this time leads to'windows error' stating that windows cannot execute this as it is about to shutdown. I think as soon as windows recieves WM_QUERYSHUTDOWN it sends all other applications WM_CLOSE which is what I think is stopping my aplication to execute any other application from itself.
Please help me in this .
Regards,
Kushagra
I hate coding but I luv to develop
|
|
|
|
|
The documentation for WM_QUERYENDSESSION says that the WM_ENDSESSION message is sent after the former message is processed. You could try ShellExecute in the WM_ENDSESSION handler.
The documentation also says that after 5 seconds the system displays information about the applications that are blocking shutdown so that the user can manually end the application. So I don't think you have much time here.
It's probably a good idea to review the requirements or design and look for alternatives.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
«_Superman_» wrote: It's probably a good idea to review the requirements or design and look for alternatives.
That's maybe used as a general advice to all the people posting here...
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]
|
|
|
|
|
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
CPallini wrote: That's maybe used as a general advice to all the people posting here...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
Thanks David,
It helped me out
Kushagra
|
|
|
|