gpt4 book ai didi

C Win32 : Window Automatically closes

转载 作者:太空宇宙 更新时间:2023-11-04 01:22:35 25 4
gpt4 key购买 nike

<分区>

我想创建一个单词“corrupter”,它实际上只是用一些 ascii 字母表替换了一些字母。但是,当按下“生成”按钮时,窗口会自动关闭

static HANDLE ghInstance;

HWND hwndEDIT;
int index[10];

static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_INITDIALOG:
{
hwndEDIT = GetWindow(hwndDlg, IDC_EDIT);

return TRUE;
}

case WM_SIZE:
/*
* TODO: Add code to process resizing, when needed.
*/
return TRUE;

case WM_COMMAND:
switch (GET_WM_COMMAND_ID(wParam, lParam))
{
case IDC_GENERATE:
{
char input[1000];
char output[1000][10];

int i, strLength, m, map;
int rNmb;
int chance;

GetWindowText(hwndEDIT, input, 1000);

srand(time(NULL));

strLength = strlen(input);

for(m=0;m<10;m++)
{
map = 0;
strcpy(output[m], input);
for(i=0;i<strLength;i++)
{
switch(output[m][i])
{
case '\0':
continue;

case '\n':
continue;

case ' ':
continue;
}

chance = rand() % 100;

if(chance < 25)
{
rNmb = (rand() % 128) + 128;

output[m][i] = rNmb;
}
}
index[m] = SendDlgItemMessage(hwndDlg , IDC_LISTBOX, LB_ADDSTRING, 0, (LPARAM)output[m]);

map++;
SendDlgItemMessage(hwndDlg, IDC_LISTBOX, LB_SETITEMDATA, (WPARAM)index[m], (LPARAM)map);
}
}
case IDC_CLOSE:
EndDialog(hwndDlg, TRUE);
return TRUE;
}
break;

case WM_CLOSE:
EndDialog(hwndDlg, 0);
return TRUE;

/*
* TODO: Add more messages, when needed.
*/
}

return FALSE;
}

我没有看到生成按钮和关闭命令之间的任何链接

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com