当前位置: 首页>>代码示例>>C++>>正文


C++ DialogBoxW函数代码示例

本文整理汇总了C++中DialogBoxW函数的典型用法代码示例。如果您正苦于以下问题:C++ DialogBoxW函数的具体用法?C++ DialogBoxW怎么用?C++ DialogBoxW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DialogBoxW函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MainWndProc

/* Message handler for dialog box */
LRESULT CALLBACK MainWndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
{
    switch (uMessage)
    {
        case WM_SYSCOMMAND:
        {
            switch (LOWORD(wParam) /*GET_WM_COMMAND_ID(wParam, lParam)*/)
            {
                case IDM_ABOUT:
                    DialogBoxW(hInst, MAKEINTRESOURCEW(IDD_ABOUTBOX), hWnd, About);
                    // break;
                    return TRUE;
            }

            // break;
            return FALSE;
        }

        case WM_COMMAND:
        {
            switch (LOWORD(wParam) /*GET_WM_COMMAND_ID(wParam, lParam)*/)
            {
                case IDM_ABOUT:
                    DialogBoxW(hInst, MAKEINTRESOURCEW(IDD_ABOUTBOX), hWnd, About);
                    // break;
                    return TRUE;
            }

            break;
            // return FALSE;
        }

        case WM_DESTROY:
        {
            if (wpOrigEditProc)
                SetWindowLongPtr(hWnd, DWLP_DLGPROC, (LONG_PTR)wpOrigEditProc);

            if (hIcon)   DestroyIcon(hIcon);
            if (hIconSm) DestroyIcon(hIconSm);
        }

        default:
            break;
    }

    /* Return */
    if (wpOrigEditProc)
        return CallWindowProc(wpOrigEditProc, hWnd, uMessage, wParam, lParam);
    else
        return FALSE;
}
开发者ID:Strongc,项目名称:reactos,代码行数:52,代码来源:msconfig.c

示例2: general_on_command

/*********************************************************************
 * general_on_command [internal]
 *
 * handle WM_COMMAND
 *
 */
static INT_PTR general_on_command(HWND hwnd, WPARAM wparam)
{

    switch (wparam)
    {
        case MAKEWPARAM(IDC_HOME_EDIT, EN_CHANGE):
            /* enable apply button */
            SendMessageW(GetParent(hwnd), PSM_CHANGED, (WPARAM)hwnd, 0);
            break;

        case MAKEWPARAM(IDC_HOME_BLANK, BN_CLICKED):
            SetDlgItemTextW(hwnd, IDC_HOME_EDIT, about_blank);
            break;

        case MAKEWPARAM(IDC_HOME_DEFAULT, BN_CLICKED):
            SetDlgItemTextW(hwnd, IDC_HOME_EDIT, default_home);
            break;

        case MAKEWPARAM(IDC_HISTORY_DELETE, BN_CLICKED):
            DialogBoxW(hcpl, MAKEINTRESOURCEW(IDD_DELETE_HISTORY), hwnd,
                       delhist_dlgproc);
            break;

        default:
            TRACE("not implemented for command: %d/%d\n", HIWORD(wparam),  LOWORD(wparam));
            return FALSE;
    }
    return TRUE;
}
开发者ID:Strongc,项目名称:reactos,代码行数:35,代码来源:general.c

示例3: CreateSettingsDlg

VOID CreateSettingsDlg(HWND hwnd)
{
    DialogBoxW(hInst,
               MAKEINTRESOURCEW(IDD_SETTINGS_DIALOG),
               hwnd,
               SettingsDlgProc);
}
开发者ID:Moteesh,项目名称:reactos,代码行数:7,代码来源:settingsdlg.cpp

示例4: install_addon

BOOL install_addon(addon_t addon_type)
{
    if(!*ARCH_STRING)
        return FALSE;

    addon = addons_info+addon_type;

    p_wine_get_dos_file_name = (void*)GetProcAddress(GetModuleHandleW(kernel32_dllW), "wine_get_dos_file_name");

    /*
     * Try to find addon .msi file in following order:
     * - directory stored in $dir_config_key value of HKCU/Software/Wine/$config_key key
     * - $datadir/$addon_subdir/
     * - $INSTALL_DATADIR/wine/$addon_subdir/
     * - /usr/share/wine/$addon_subdir/
     * - download from URL stored in $url_config_key value of HKCU/Software/Wine/$config_key key
     */
    if (install_from_registered_dir() == INSTALL_NEXT
        && install_from_default_dir() == INSTALL_NEXT
        && install_from_cache() == INSTALL_NEXT
        && (url = get_url()))
        DialogBoxW(hInst, addon->dialog_template, 0, installer_proc);

    heap_free(url);
    url = NULL;
    return TRUE;
}
开发者ID:iXit,项目名称:wine,代码行数:27,代码来源:addons.c

示例5: install_wine_gecko

BOOL install_wine_gecko(BOOL silent)
{
    HANDLE hsem;

    SetLastError(ERROR_SUCCESS);
    hsem = CreateSemaphoreA( NULL, 0, 1, "mshtml_install_semaphore");

    if(GetLastError() == ERROR_ALREADY_EXISTS) {
        WaitForSingleObject(hsem, INFINITE);
    }else {
        /*
         * Try to find Gecko .cab file in following order:
         * - directory stored in GeckoCabDir value of HKCU/Software/MSHTML key
         * - $datadir/gecko
         * - download from URL stored in GeckoUrl value of HKCU/Software/MSHTML key
         */
        if(!install_from_registered_dir()
           && !install_from_default_dir()
           && !silent && (url = get_url()))
            DialogBoxW(hInst, MAKEINTRESOURCEW(ID_DWL_DIALOG), 0, installer_proc);
    }

    ReleaseSemaphore(hsem, 1, NULL);
    CloseHandle(hsem);

    return TRUE;
}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:27,代码来源:install.c

示例6: strcpy

char *winpassword(pdfapp_t *app, char *filename)
{
	char buf[1024], *s;
	int code;

	if (password)
	{
		char *p = password;
		password = NULL;
		return p;
	}

	strcpy(buf, filename);
	s = buf;
	if (strrchr(s, '\\')) s = strrchr(s, '\\') + 1;
	if (strrchr(s, '/')) s = strrchr(s, '/') + 1;
	if (strlen(s) > 32)
		strcpy(s + 30, "...");
	sprintf(pd_filename, "The file \"%s\" is encrypted.", s);
	code = DialogBoxW(NULL, L"IDD_DLOGPASS", hwndframe, dlogpassproc);
	if (code <= 0)
		winerror(app, "cannot create password dialog");
	if (pd_okay)
		return pd_password;
	return NULL;
}
开发者ID:n1tehawk,项目名称:mupdf,代码行数:26,代码来源:win_main.c

示例7: CreateAboutBox

INT_PTR CreateAboutBox(void)
{
	INT_PTR r;
	dialog_showing++;
	r = DialogBoxW(hMainInstance, MAKEINTRESOURCEW(IDD_ABOUTBOX + IDD_OFFSET), hMainDialog, AboutCallback);
	dialog_showing--;
	return r;
}
开发者ID:DesignD,项目名称:rufus,代码行数:8,代码来源:stdlg.c

示例8: ConfirmSubstitute

SEARCHCONFIRMRESULT ConfirmSubstitute(void)
{	SEARCHCONFIRMRESULT	Res;
	static DLGPROC		DlgProc;

	if (!DlgProc)
		 DlgProc = (DLGPROC)MakeProcInstance((FARPROC)SubstChkCallback, hInst);
	Res = DialogBoxW(hInst, MAKEINTRESW(IDD_SUBSTCONFIRM), hwndMain, DlgProc);
	return (Res);
}
开发者ID:mike2718,项目名称:WinVi,代码行数:9,代码来源:SrchDlg.c

示例9: wWinMain

int APIENTRY wWinMain(HINSTANCE hInstance,
                      HINSTANCE hPrevInstance,
                      LPWSTR    lpCmdLine,
                      int       nCmdShow)
{
    UNREFERENCED_PARAMETER(hPrevInstance);
    UNREFERENCED_PARAMETER(lpCmdLine);

    return DialogBoxW(hInstance, MAKEINTRESOURCEW(IDD_ABOUTBOX), NULL, About);
}
开发者ID:Moteesh,项目名称:reactos,代码行数:10,代码来源:winstation.c

示例10: fz_strlcpy

char *wintextinput(pdfapp_t *app, char *inittext, int retry)
{
	int code;
	td_retry = retry;
	fz_strlcpy(td_textinput, inittext ? inittext : "", sizeof td_textinput);
	code = DialogBoxW(NULL, L"IDD_DLOGTEXT", hwndframe, dlogtextproc);
	if (code <= 0)
		winerror(app, "cannot create text input dialog");
	if (pd_okay)
		return td_textinput;
	return NULL;
}
开发者ID:AvinashKiran,项目名称:mupdf,代码行数:12,代码来源:win_main.c

示例11: winchoiceinput

int winchoiceinput(pdfapp_t *app, int nopts, char *opts[], int *nvals, char *vals[])
{
	int code;
	cd_nopts = nopts;
	cd_nvals = nvals;
	cd_opts = opts;
	cd_vals = vals;
	code = DialogBoxW(NULL, L"IDD_DLOGLIST", hwndframe, dlogchoiceproc);
	if (code <= 0)
		winerror(app, "cannot create text input dialog");
	return pd_okay;
}
开发者ID:AvinashKiran,项目名称:mupdf,代码行数:12,代码来源:win_main.c

示例12: WinMain

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
    HANDLE hProcess;
    HANDLE hToken; 
    TOKEN_PRIVILEGES tkp; 

    /* Initialize global variables */
    hInst = hInstance;

    /* Change our priority class to HIGH */
    hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, GetCurrentProcessId());
    SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS);
    CloseHandle(hProcess);

    /* Now let's get the SE_DEBUG_NAME privilege
     * so that we can debug processes 
     */

    /* Get a token for this process.  */
    if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) {
        static const WCHAR SeDebugPrivilegeW[] = {'S','e','D','e','b','u','g','P','r','i','v','i','l','e','g','e',0};

        /* Get the LUID for the debug privilege.  */
        LookupPrivilegeValueW(NULL, SeDebugPrivilegeW, &tkp.Privileges[0].Luid);

        tkp.PrivilegeCount = 1;  /* one privilege to set */
        tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; 

        /* Get the debug privilege for this process. */
        AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, NULL, 0);
    }

    /* Load our settings from the registry */
    LoadSettings();

    /* Initialize perf data */
    if (!PerfDataInitialize()) {
        return -1;
    }

    DialogBoxW(hInst, (LPWSTR)IDD_TASKMGR_DIALOG, NULL, TaskManagerWndProc);
 
    /* Save our settings to the registry */
    SaveSettings();
    PerfDataUninitialize();
    return 0;
}
开发者ID:Sunmonds,项目名称:wine,代码行数:50,代码来源:taskmgr.c

示例13: DoCameraUI

BOOL DoCameraUI(void)
{
	HKEY key;
	DWORD data = 0;
	DWORD size = sizeof(data);
	if (RegOpenKeyExA(HKEY_CURRENT_USER, settings_key, 0, KEY_READ, &key) == ERROR_SUCCESS) {
		RegQueryValueExA(key, settings_value, NULL, NULL, (LPBYTE) &data, &size);
		RegCloseKey(key);
		if (data)
			return GetAllImages();
	}
	return DialogBoxW(GPHOTO2_instance,
			(LPWSTR)MAKEINTRESOURCE(IDD_CAMERAUI),NULL, DialogProc);
}
开发者ID:GeonHun,项目名称:wine,代码行数:14,代码来源:ui.c

示例14: viewerShowChooseValueWindowEx

/*Отображает окно выбора числа в диапазоне от min до max с возможностью выбора размера шага*/
bool viewerShowChooseValueWindowEx(wchar_t *caption, int min, int max, int *val, int step)
{	
	viewer_cvwin_minval = min;
	viewer_cvwin_maxval = max;
	viewer_cvwin_newval = *val;
	viewer_cvwin_step = step;
	viewer_cvwin_caption = caption;
	
	if(DialogBoxW(viewer_win_hInstance, L"DIALOG_2", viewer_win_hWnd, viewerChooseValueWndProc) == 100) {
		*val = viewer_cvwin_newval;
		return true;
	}
	
	return false;
}
开发者ID:plzombie,项目名称:Image_processing,代码行数:16,代码来源:viewer_choosevalue.c

示例15: slot1Dialog

void slot1Dialog(HWND hwnd)
{
	strcpy(tmp_fat_path, slot1_GetFatDir().c_str());
	strcpy(tmp_fs_path, path.getpath(path.SLOT1D).c_str());
	temp_type_slot1 = slot1_GetCurrentType();
	last_type_slot1 = temp_type_slot1;
	_OKbutton_slot1 = false;
	needReset_slot1 = true;
	u32 res=DialogBoxW(hAppInst, MAKEINTRESOURCEW(IDD_SLOT1CONFIG), hwnd, (DLGPROC)Slot1Box_Proc);
	if (res)
	{
		switch (temp_type_slot1)
		{
			case NDS_SLOT1_NONE:
				if (temp_type_slot1 != slot1_GetCurrentType())
					needReset_slot1 = true;
				else
					needReset_slot1 = false;
				break;
			case NDS_SLOT1_RETAIL_AUTO:
			case NDS_SLOT1_RETAIL_MCROM:
				break;
			case NDS_SLOT1_R4:
				if (strlen(tmp_fat_path))
				{
					slot1_SetFatDir(tmp_fat_path);
					WritePrivateProfileString("Slot1","FAT_path",tmp_fat_path,IniName);
				}
				break;
			case NDS_SLOT1_RETAIL_NAND:
				break;
			case NDS_SLOT1_RETAIL_DEBUG:
				if (strlen(tmp_fs_path))
				{
					path.setpath(path.SLOT1D, tmp_fs_path);
					WritePrivateProfileString(SECTION, SLOT1DKEY, path.pathToSlot1D, IniName);
				}
				break;
			default:
				return;
		}
		WritePrivateProfileInt("Slot1","type",temp_type_slot1,IniName);

		slot1_Change((NDS_SLOT1_TYPE)temp_type_slot1);
		
		return;
	}
}
开发者ID:rafaelmessias,项目名称:desmume,代码行数:48,代码来源:slot1_config.cpp


注:本文中的DialogBoxW函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。