-
August 16th, 2005, 07:44 AM
#1
Zombie dialog
Hello everybody
I am developing application which uses Microsoft Crypto API and I encountered strange behaviour, which I cannot explain. It is CONSOLE application, which performs signing data using certificate located at Windows certificate store. Everything seems to work fine, as long as certificate used to sign data has 'Use private key strong protection' option disabled (Im sorry, I have no English Windows version, and I do not know how exactly this option is called). When certificate has this option enabled, following thing should happen:
1. My program calls CryptSignHash function (CryptoAPI function)
2. Windows pops up MODAL dialog which says that protected certificate is going to be used
3. User confirms (or cancels)
4. Application runs further
Strange thing is that application works like this:
1. My program calls CryptSignHash function (CryptoAPI function)
2. Program hangs, and stops responding
3. When I restart program or just run another instance of it (when 1st one is sill frozen), program works as supposed.
I found out that modal dialog which should be displayed by CryptSignHash function is created, but it is not displayed. It stays invisible and blocks instance of my application. It can be looked up using EnumWindows, FindWindow or Spy++ and forced to display with ShowWindow and its hWnd. Then user is able to confirm or reject operation and all works OK. Whats strange, since this time dialog behaves correctly: it pops up and can be clicked when user wants to sign data again. Only first call to CryptSignHash is stopped by this 'zombie' dialog window and gets frozen.
I use WinXP Prof SP2 and MSVC 7.1
If anyone knows any workaround for this, or ever encountered invisible modal windows, or has any idea whats going on, please help.
Thank you
Hob
B+!
'There is no cat' - A. Einstein
Use [code] [/code] tags!
Did YOU share your photo with us at CG Members photo gallery ?
-
August 16th, 2005, 08:42 AM
#2
Re: Zombie dialog
well you should mark your dialog as VISIBLE in your dialog properties in the dialog editor.
You wouldn't be tinkering in the WM_PAINT message call would you?
Where do you call SHOWWINDOW from?
What other window messages are you using?
It is CONSOLE application, which performs signing data using certificate located at Windows
How exactly are you calling a dialog from a consol application? If you're instanciating your dialog, and you don't want this behavoir you might try creating a modless instead of a modal dialog.
-
August 16th, 2005, 08:51 AM
#3
Re: Zombie dialog
I think that you misunderstood me: NEITHER CryptSignHash function, NOR troublesome dialog window is MINE. Function comes from Microsoft CryptoAPI (and its enclosed in some dll) and it pops dialog up. And I also thought that calling graphical elements from console app can be a cause, but I saw a lot of programs which work in this way and behave correctly.
Hob
B+!
'There is no cat' - A. Einstein
Use [code] [/code] tags!
Did YOU share your photo with us at CG Members photo gallery ?
-
August 18th, 2021, 05:51 AM
#4
Re: Zombie dialog
Hi Hobson,
I have the same problem and I wondered if you have a solution for it.
Thanks
-
August 18th, 2021, 08:03 AM
#5
Re: Zombie dialog
Originally Posted by amacias
Hi Hobson,
I have the same problem and I wondered if you have a solution for it.
Thanks
Hobson hasn't been seen here since 2013
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|