
Untitled
By: a guest on
Dec 31st, 2010 | syntax:
C | size: 1.15 KB | hits: 63 | expires: Never
#include "AutoClicker.h"
lpWnd InitNode( HWND hwnd ) {
lpWnd newNode = ( lpWnd )malloc( sizeof wnd );
newNode -> hwnd = hwnd;
newNode -> next = NULL;
return newNode;
}
void AddNode( lpWnd current, lpWnd newNode ) {
if( current == NULL ) {
return;
} else if( current -> next == NULL ) {
current -> next = newNode;
} else {
return AddNode( current -> next, newNode );
}
}
void DeleteAllNodes( lpWnd current ) {
if( current != NULL ) {
lpWnd nextNode = current -> next;
free( current );
return DeleteAllNodes( nextNode );
}
}
lpWnd GetNode( lpWnd current, int nIndex ) {
if( current == NULL ) {
return current;
} else if( nIndex == 0 ) {
return current;
} else {
return GetNode( current -> next, nIndex - 1 );
}
}
bool CompareLinkedLists( lpWnd current1, lpWnd current2 ) {
if( current1 == NULL && current2 == NULL ) {
return true;
} else if( current1 == NULL || current2 == NULL ) {
return false;
} else if( current1 -> hwnd != current2 -> hwnd ) {
return false;
} else {
return CompareLinkedLists( current1 -> next, current2 -> next );
}
}