Install 이벤트 완료
This commit is contained in:
@@ -32,6 +32,12 @@ namespace StudioClient
|
||||
|
||||
static readonly HttpClient httpClient = new HttpClient();
|
||||
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
||||
public static extern uint RegisterWindowMessage(string lpString);
|
||||
|
||||
private uint installCompleteMsg;
|
||||
private uint uninstallCompleteMsg;
|
||||
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -41,6 +47,9 @@ namespace StudioClient
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
installCompleteMsg = RegisterWindowMessage($@"INSTALL_COMPLETE");
|
||||
uninstallCompleteMsg = RegisterWindowMessage($@"UNINSTALL_COMPLETE");
|
||||
|
||||
string installPath;
|
||||
|
||||
installPath = GetInstalledPathFromRegistry(appName_Studio);
|
||||
@@ -77,7 +86,6 @@ namespace StudioClient
|
||||
private async void StudioInstallButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
await OnClickButton(appName_Studio);
|
||||
SetButtonState(true, StudioInstallButton, StudioCheckButton, StudioDeleteButton);
|
||||
}
|
||||
|
||||
private async void StudioTwinInstallButton_Click(object sender, EventArgs e)
|
||||
@@ -277,21 +285,14 @@ namespace StudioClient
|
||||
}
|
||||
}
|
||||
|
||||
// Uninstall 완료 시
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
||||
public static extern uint RegisterWindowMessage(string lpString);
|
||||
|
||||
private uint uninstallCompleteMsg;
|
||||
|
||||
protected override void OnHandleCreated(EventArgs e)
|
||||
{
|
||||
base.OnHandleCreated(e);
|
||||
uninstallCompleteMsg = RegisterWindowMessage("UVC_UNINSTALL_COMPLETE");
|
||||
}
|
||||
|
||||
// Install / Uninstall 완료 시
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
if (m.Msg == uninstallCompleteMsg)
|
||||
if (m.Msg == installCompleteMsg)
|
||||
{
|
||||
SetButtonState(true, StudioInstallButton, StudioCheckButton, StudioDeleteButton);
|
||||
}
|
||||
else if (m.Msg == uninstallCompleteMsg)
|
||||
{
|
||||
SetButtonState(false, StudioInstallButton, StudioCheckButton, StudioDeleteButton);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user