Changing XServer priority



I need to find a process ID within my C++ application using process
name ? I have googled it a lot , could not find anything on the
internet.

Anybody knows how I can I find process ID by just prividing the
process name ?

.