詳しい方教えてください。C言語でマイクから入力した音声を変調してリアルタイムでスピーカーから出力するプログラムを作っています。現在はプログラムは開始を押すと動き始める、という段階まで作ってあるのですが、開始ボタンを押すと応答なしになるのに普通に動いている。という状態になってしまいます。コンパイラはGCCで、使用言語はCです。いろいろ調べたのですが、原因がわかりませんでした。以下がソースコードです。
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<windows.h>
#include<mmsystem.h>
#include<conio.h>
#include<commctrl.h>
#define BUTTON_ID1 0
#define BUTTON_ID2 1
#define ID_TRACK 100
#define ID_STATIC 101
#define NUMBER_OF_BUFFER 8
#define BUFFER_SIZE 160
#define ScreenCenterX(width) ((0)<((int)((GetSystemMetrics(SM_CXSCREEN)-Width)/2))?(int)((GetSystemMetrics(SM_CXSCREEN)-Width)/2)):(0))
#define ScreenCenterY(Height) ((0)<((int)((GetSystemMetrics(SM_CYSCREEN)-Height)/2))?(int)((GetSystemMetrics(SM_CYSCREEN)-Height)/2)):(0))
HWND CreateMainWindow
(int Width,int Height,LPCTSTR Caption
,HINSTANCE hInstance,int nCmdShow
,WNDPROC lpfnWndProc,DWORD dwstyle
,DWORD dwExstyle,LPCTSTR MenuID
,HICON hIcon);
HWND CreateControlWindow
(HWND hwndParent,int Left,int Top
,int Width,int Height,int dwExStyle
,int dwFlag,LPCTSTR ClassName
,HMENU ChildID,HINSTANCE hInstance);
int WINAPI WinMain
(HINSTANCE hInstance
,HINSTANCE hPrevInstance
,LPSTR lpszCmdLine,int nCmdShow);
LRESULT CALLBACK WindowProc
(HWND hwnd,UINT uMsg
,WPARAM wParam
,LPARAM lParam);
HWND hTrack,hStatic;
char i[128];
int *a=0;
int b=0;
int plus1(int *m);
DOUBLE am,fm;
HWND CreateControlWindow
(HWND hwndParent,int Left,int Top
,int Width, int Height,int dwExStyle
,int dwFlag,LPCTSTR Caption
,LPCTSTR ClassName,HMENU ChildID
,HINSTANCE hInstance)
{
return CreateWindowEX
(dwExStyle,ClassName,Caption
,WS_CHILD | WS_VISIBLE | dwFlag
,Left,Top,Width,Height,hwndParent
,ChildID,hInstance,NULL);
}
LRESULT CALLBACK WndProc
(HWND hwnd,UINT msg,WPARAM wp
,LPARAM lp)
{
char buffer[100];
switch(msg){
case WM_DESTROY:
PostQuitMessage(0);
return 0;
case WM_CREATE:
hStatic=CreateControlWindow
(hwnd,10,10,250,45,0,0,""
,"STATIC",(HMENU)ID_STATIC
,(HINSTANCE)GetWindowLong
(hwnd,GWL_HINSTANCE));
hTrack=CreateControlWindow(hwnd
,10,60,280,55,0
,TBS_AUTOTICKS,""
,TRACKBAR_CLASS
,(HMENU)ID_TRACK
,(HINSTANCE)GetWindowlong
(hwnd,GWL_HINSTANCE));
SendMessage(hTrack,TBM_SETRANGE
,TRUE,MAKELONG(300,1000));
SendMessage(hTrack,TBM_SETPAGESIZE
,0,10);
SendMessage(hTrack,TBM_SETLINESIZE
,0,1);
SendMessage(hTrack,TBM_SETPOS
,TRUE,100);
SendMessage(hTrack,TBM_SETTICFREQ
,30,0);
SetFocus(hTrack);
break;
case WM_HSCROLL:
if((HWND)(lp)==hTrack)
{
wsprintf(buffer
,"現在の周波数は%d[Hz]
です。",SendMessage
(hTrack,TBM_GETPOS,0,0));
SendMessage(hStatic,WM_SETTEXT
,0,(LPARAM)buffer);
}
break;
hTrack=&fm;
case WM_COMMAND: