This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO `music`.`genre` | |
VALUES (0, 'Blues'), | |
(1, 'Classic Rock'), | |
(2, 'Country'), | |
(3, 'Dance'), | |
(4, 'Disco'), | |
(5, 'Funk'), | |
(6, 'Grunge'), | |
(7, 'Hip-Hop'), | |
(8, 'Jazz'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void StrTrimLeft(char *source, char *dest) | |
{ | |
int nIndex = 0; | |
while (source[nIndex] == ' ') | |
nIndex++; | |
strcpy(dest, &source[nIndex]); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void removeQuotes(LPSTR szCommand) | |
{ | |
int nGet = 0, nSet = 0; | |
while (szCommand[nGet] != '\0') | |
{ | |
if (szCommand[nGet] == '\"') | |
nGet++; | |
else | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int GetColorsBits() | |
{ | |
HDC hScreenDC = GetDC(0); | |
int nColorBits = GetDeviceCaps(hScreenDC, BITSPIXEL) * GetDeviceCaps(hScreenDC, PLANES); | |
ReleaseDC(NULL, hScreenDC); | |
return nColorBits; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Display 'Open File' dialog-box | |
BOOL OpenFileDialog(LPSTR lpFilename) | |
{ | |
OPENFILENAME of; | |
char szFilter[] = "Music Files (*.ogg)\0*.ogg\0Image Files (*.png)\0*.png\0All files (*.*)\0*.*\0\0"; | |
char szFile[MAX_PATH] = "\0"; | |
char szTitle[] = "Select a file"; | |
char szExt[] = "ogg"; | |
of.lStructSize = sizeof(of); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HWND of text element | |
void CopyEditToClipboard(HWND hWnd) | |
{ | |
SendMessage(hWnd, EM_SETSEL, 0, 65535L); | |
SendMessage(hWnd, WM_COPY, 0 , 0); | |
SendMessage(hWnd, EM_SETSEL, 0, 0); | |
} | |
// Example | |
CopyEditToClipboard(GetDlgItem(hwndDlg, IDC_EDIT_MAIN)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void CenterWindow(HWND hWnd) | |
{ | |
RECT rcWin; | |
GetWindowRect(hWnd, &rcWin); | |
SetWindowPos(hWnd, NULL, (GetSystemMetrics(SM_CXFULLSCREEN) - (rcWin.right - rcWin.left + 1)) / 2, | |
(GetSystemMetrics(SM_CYFULLSCREEN) - (rcWin.bottom - rcWin.top + 1)) / 2, | |
0, 0, SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double exp2(double n) | |
{ | |
return pow(2.0, n); | |
} | |
double log2(double n) | |
{ | |
return log(n) / log(2.0); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
int main() | |
{ | |
int width = GetSystemMetrics(SM_CXVIRTUALSCREEN); | |
int height = GetSystemMetrics(SM_CYVIRTUALSCREEN); | |
int top = GetSystemMetrics(SM_YVIRTUALSCREEN); | |
int left = GetSystemMetrics(SM_XVIRTUALSCREEN); | |
int size = width * height * 3; | |
int headerSize = sizeof(BITMAPINFOHEADER) + sizeof(BITMAPFILEHEADER); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <Shlwapi.h> | |
#include <stdio.h> | |
#pragma comment(lib, "shlwapi.lib") | |
char* assocStr[] = | |
{ | |
"ASSOCSTR_COMMAND", | |
"ASSOCSTR_EXECUTABLE", | |
"ASSOCSTR_FRIENDLYDOCNAME", |
OlderNewer