|
Hi!
A user maximizes the application on monitor #2 and then exits the program. When starting up again, trying to maximize the window using ShowWindow(SW_MAXIMIZE) maximizes the window on monitor #1, instead of the expected #2.
Is there any way to set the preferred/active monitor? Optimally, a subsequent call to ShowWindow(SW_MAXIMIZE) should then maximize the window on monitor #2.
Thanks and best regards
Dominik
|
|
|
|
|
Yes, use GetWindowPlacement to record the window max/min state, size, and monitor when the app exits, store the returned struct as binary data in the registry (or elsewhere), and the use SetWindowPlacement when the app boots the next time. Don't forget to handle bizarre situations as when a user discards a monitor or changes screen resolution.
|
|
|
|
|
Has anyone implemented secure IPC? I need to implement something in native code, and I need some direction.
Is there a way to have my processes dynamically generate public/private key pairs and use that kind of encryption?
|
|
|
|
|
Independent123 wrote: Is there a way to have my processes dynamically generate public/private key pairs and use that kind of encryption?
The CryptoAPI[^] tools have worked well for me. They're high level APIs
so relatively simple to use.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Ah, yes! Thanks Mark, that seems to be what I need!
|
|
|
|
|
Hi friends..
Any one of you had developed the code for Integer DCT in c or C++ or in MATLAB? if so plz let have the code. I need it for my research. Plz let me share that. Thanks in advance..
Sivadanams
|
|
|
|
|
Quoting Chris Maunder:
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
George
-- modified at 14:50 Saturday 27th October, 2007
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
hi all
I need to change picture in my dialog, when user push some button.
it is firts time when I use Picture control im my dialog.
help me if you can.
|
|
|
|
|
Are you using MFC or straight Win32 APIs?
The basic steps are:
1) respond to button press
2) load a new bitmap for the picture control
3) set the picture control's bitmap to the new bitmap
Which part are you having trouble with?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have problem with step #3 I cant replase bitmap .
|
|
|
|
|
thanks
I Find in MSDN class CStatic and I solve my problem using this class.
|
|
|
|
|
If you want to set picture to a control like Static you can use of SetBitmap that it gets a hbitmap for parameter and also use of LoadImage or CImage class for load image.
|
|
|
|
|
Hi,
I have a DLL write in VC , in this DLL a function is declare follow :
BOOL InitMyDLL(LPWORD Alpha, LPWORD wrdpack);
now i want use this function in my VB project , but any type get for LPWORD (Inteeger , long , double ,...) and run my project when this function call get this error :
run-time error '49':
bad DLL calling convertion.
I Declaration this function in VB follow :
private declare Function InitMyDLL lib "MYDLL" (ByRef Alpha, Packet() as long) as Boolean
second parameter is a array !!!
please help me,
thanks for all.
|
|
|
|
|
i am new to vc++ programming and i want to make an invisible text box visible during runt time. i made the variable name with type CString for that text box. Can anybody help me in solving this problem.
|
|
|
|
|
you said you made the variable with type CString. thats fine.
you also create one variable for that same text box as type CEdit from class wizard.
now, whereever you want to hide it,
call as follows.
variable.ShowWindow(FALSE);
or you can do like this also, but iam not sure
GetWindow(IDC_EDIT1)->ShowWindow(FALSE);
obviously, make it TRUE to Show it.
Good luck.
-- modified at 3:59 Saturday 27th October, 2007
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
|
I think this can be done by right clicking the Edit box----properties--->select the "Visible"(checked).(in the Resourse View)
Or
u can do it using the same command as chandu told..
i.e., GetDlgItem(IDC_EDIT)->ShowWindow(TRUE)
I thnk this command brings you the solution.
Thanks,,
saravana...
|
|
|
|
|
Chandu's answer is right. But don't use the code in the OnDraw () or OnPaint () messages, you will start a loop or update the window. Put it in a button, mouse click or something like that
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
in my vc project: i write assembly codes (with __asm keyword). i compile my project in windows 32 bit, it has any error. BUT in Windows 64 bit, it doesn't know __asm keyword and other assembly instruction. what do i do?
Zo.Naderi-Iran
|
|
|
|
|
|
Hi,
In a dll's ininstance , I am loading a dll with LoadLibrary & Setting the returned handle
as Application's resource handle, with AfxSetResourceHandle(Server side). Later, when a client request to the server, I check the resource handle of the application with AfxGetResourceHandle, it is 0. Can anyone tell why?
Vinod.C.S
|
|
|
|
|
Have you tried with AFX_MANAGE_STATE ?
Please refer here[^] for more information.
Regards,
Paresh.
|
|
|
|
|
So let's say that I have something like:
class A
{
public: virtual void foo() {...}
};
class B : public A
{
public: virtual void foo() { A::foo(); ... }
};
In the overwritten method foo , I used the sentence A::foo in order to call the parent's version of this method. Now, let's say that rather than overwritting a method, I want to overwrite an operator overload. How would I call the parent's version? I mean:
class A
{
public: A& operator= (const A& a) { ... }
};
class B : public A
{
public: B& operator= (const B& b) {
...
}
};
Is it even possible?
Thanks in advance.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
Do you get any errors using that code?
-- modified at 6:15 Saturday 27th October, 2007
// "In the end it's a little boy expressing himself." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
Actually I haven't tried it, I just made it up in order to express my doubt. Now that you've mentioned it, I'm gonna try. Still, would this be standard compliant?
Thanks for your reply.
Hope is the negation of reality - Raistlin Majere
|
|
|
|