void InitSettingsDlg(void) { /* Menu Item */ hServiceMenuCommand = CreateServiceFunction("AutoShutdown/MenuCommand", MenuItemCommand); hMainMenuItem=hTrayMenuItem=NULL; SetShutdownMenuItem(false); /* Hotkey */ AddHotkey(); /* Services */ hwndSettingsDlg=NULL; hServiceShowDlg = CreateServiceFunction(MS_AUTOSHUTDOWN_SHOWSETTINGSDIALOG, ServiceShowSettingsDialog); }
VOID Init(HWND hwndDlg) { char szINI[MAX_PATH]; INT x; LVCOLUMN lvc; HWND hwndList = GetDlgItem(hwndDlg, IDC_POINTERS); HWND hwndHotkeys = GetDlgItem(hwndDlg, IDC_HOTKEYS); // set icon HICON hMain = LoadIcon(g_hinstApp, MAKEINTRESOURCE(IDI_MAIN)); SendMessage(hwndDlg, WM_SETICON, TRUE, (LPARAM)hMain); SendMessage(hwndDlg, WM_SETICON, FALSE, (LPARAM)hMain); // setup pointer list box ListView_SetExtendedListViewStyle(hwndList, LVS_EX_FULLROWSELECT); lvc.mask = LVCF_WIDTH; lvc.cx = 140; ListView_InsertColumn(hwndList, 0, &lvc); lvc.cx = 70; ListView_InsertColumn(hwndList, 1, &lvc); // setup hotkey list box ListView_SetExtendedListViewStyle(hwndHotkeys, LVS_EX_FULLROWSELECT); lvc.mask = LVCF_WIDTH; lvc.cx = 110; ListView_InsertColumn(hwndHotkeys, 0, &lvc); lvc.cx = 100; ListView_InsertColumn(hwndHotkeys, 1, &lvc); // setup buttons EnableWindow(GetDlgItem(hwndDlg, IDC_SCAN), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_SAVE), FALSE); // add pointers scanPresent_Init(hwndList); scanReset_Init(hwndList); scanWowWindowProc_Init(hwndList); scanBwhWindowProc_Init(hwndList); scanGetMap_Init(hwndList); scanGetGuidData_Init(hwndList); scanGetGuidDataConstant1_Init(hwndList); scanGetGuidDataConstant2_Init(hwndList); scanGetCharacterGuid_Init(hwndList); scanFallingTeleport_Init(hwndList); scanCameraAngle_Init(hwndList); scanSendChatMessage_Init(hwndList); scanTrackingHook_Init(hwndList); scanTrackingJumpSize_Init(hwndList); scanTrackingTrackStructOffset_Init(hwndList); scanTrackingTrackDataOffset_Init(hwndList); scanTrackingCharStruct2Offset_Init(hwndList); scanTrackingCharTypeOffset_Init(hwndList); scanTrackingNpcDataOffset_Init(hwndList); scanNameLookup_Init(hwndList); scanCorpse_Init(hwndList); scanNoFallDamageHook_Init(hwndList); scanNoFallDamageOffset_Init(hwndList); scanZeroGravity_Init(hwndList); scanMountainClimb_Init(hwndList); scanLockSpeed_Init(hwndList); scanTeleportToPlane_Init(hwndList); scanFollowNpc1_Init(hwndList); scanFollowNpc2_Init(hwndList); scanFollowFaction_Init(hwndList); scanFollowDistance_Init(hwndList); // add hotkeys AddHotkey(hwndHotkeys, "ShowHide", VK_F12); AddHotkey(hwndHotkeys, "X-Plus", VK_NUMPAD6); AddHotkey(hwndHotkeys, "X-Minus", VK_NUMPAD4); AddHotkey(hwndHotkeys, "Y-Plus", VK_NUMPAD8); AddHotkey(hwndHotkeys, "Y-Minus", VK_NUMPAD2); AddHotkey(hwndHotkeys, "Z-Plus", VK_NUMPAD9); AddHotkey(hwndHotkeys, "Z-Minus", VK_NUMPAD3); AddHotkey(hwndHotkeys, "Speed-Plus", VK_NUMPAD7); AddHotkey(hwndHotkeys, "Speed-Minus", VK_NUMPAD1); AddHotkey(hwndHotkeys, "NormalSpeed", VK_NUMPAD5); AddHotkey(hwndHotkeys, "Teleport", VK_MULTIPLY); AddHotkey(hwndHotkeys, "QuickSave", VK_DECIMAL); AddHotkey(hwndHotkeys, "QuickLoad", VK_NUMPAD0); AddHotkey(hwndHotkeys, "TrackAlliance", CTRL | ALT | 'A'); AddHotkey(hwndHotkeys, "TrackHorde", CTRL | ALT | 'H'); AddHotkey(hwndHotkeys, "TrackBeasts", CTRL | ALT | '1'); AddHotkey(hwndHotkeys, "TrackDemons", CTRL | ALT | '2'); AddHotkey(hwndHotkeys, "TrackDragons", CTRL | ALT | '3'); AddHotkey(hwndHotkeys, "TrackElementals", CTRL | ALT | '4'); AddHotkey(hwndHotkeys, "TrackGiants", CTRL | ALT | '5'); AddHotkey(hwndHotkeys, "TrackHumanoids", CTRL | ALT | '6'); AddHotkey(hwndHotkeys, "TrackUndead", CTRL | ALT | '7'); AddHotkey(hwndHotkeys, "TrackMachines", CTRL | ALT | '8'); AddHotkey(hwndHotkeys, "TrackSlimes", CTRL | ALT | '9'); AddHotkey(hwndHotkeys, "TrackCritters", CTRL | ALT | '0'); AddHotkey(hwndHotkeys, "TrackTreasure", CTRL | ALT | 'T'); AddHotkey(hwndHotkeys, "TrackObjects", CTRL | ALT | 'O'); AddHotkey(hwndHotkeys, "TrackHerbs", CTRL | ALT | 'F'); AddHotkey(hwndHotkeys, "TrackMinerals", CTRL | ALT | 'M'); AddHotkey(hwndHotkeys, "NoFallDamage", CTRL | 'N'); AddHotkey(hwndHotkeys, "MountainClimb", CTRL | 'M'); AddHotkey(hwndHotkeys, "LockSpeed", CTRL | 'L'); AddHotkey(hwndHotkeys, "ZeroGravity", CTRL | 'Z'); AddHotkey(hwndHotkeys, "TeleportToPlane", CTRL | 'T'); AddHotkey(hwndHotkeys, "FollowNpc", CTRL | 'F'); AddHotkey(hwndHotkeys, "GoToCorpse", CTRL | 'C'); AddHotkey(hwndHotkeys, "GPS", CTRL | 'G'); // setup font boxes GetModuleFileName(GetModuleHandle(NULL), szINI, MAX_PATH); for(x = lstrlen(szINI); x && szINI[x] != '\\'; x--); szINI[x] = '\0'; lstrcat(szINI, "\\bwh.ini"); GetPrivateProfileString("FONTS", "FixedFont", "Terminal", g_szFixedFont, sizeof(g_szFixedFont), szINI); g_lFixedSize = GetPrivateProfileInt("FONTS", "FixedSize", 9, szINI); g_bFixedBold = GetPrivateProfileInt("FONTS", "FixedBold", FALSE, szINI); GetPrivateProfileString("FONTS", "ProportionalFont", "Arial", g_szProportionalFont, sizeof(g_szProportionalFont), szINI); g_lProportionalSize = GetPrivateProfileInt("FONTS", "ProportionalSize", 8, szINI); g_bProportionalBold = GetPrivateProfileInt("FONTS", "ProportionalBold", FALSE, szINI); SetFixedWidthFont(hwndDlg, g_szFixedFont, g_lFixedSize, g_bFixedBold); SetProportionalFont(hwndDlg, g_szProportionalFont, g_lProportionalSize, g_bProportionalBold); // fill in wow path FindWOW(hwndDlg); }