Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,

I have c# parent window and a c++ child window.

I am writing c++ child window postion and coordinates to registry so that if again c++ window is launched from c#, it retains the same position for the current session

C++
WINDOWPLACEMENT wp;
GetWindowPlacement(&wp);
AfxGetApp()->WriteProfileBinary("MainFrame", "WP", (LPBYTE)&wp, sizeof(wp));



But if parent window itself is closed i want to delete that registry so that for first time the c++ child window takes default position and coordinates.


So how do i delete WINDOWPLACEMENT registry created in c++ from the c# code
Posted
Comments
Philippe Mori 20-Aug-15 8:35am    
Language has nothing to do... You simply use .NET functions that manipulate registry instead of Win API ones.

 
Share this answer
 
Comments
yash35 19-Aug-15 16:50pm    
Is there any way to achieve this in c++ code itself. or some other way to achieve this
Solution: Don't do this
Using Windows Registry Hive for this is overkill.

Note: The language used to create a registry entry have no impact on the way to delete the same registry entry, whatever is the language used to do it.

You simply need to set variables to store the window position, the variables values simply have to persist between child window calls.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900