ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   WinAPI Functions (https://www.excelbanter.com/excel-programming/287609-winapi-functions.html)

solex

WinAPI Functions
 
Is it possible to use WinAPI functions such as SendMessage. I would like to
use this API for searching for items in a listbox but cannot find the HWND
property. In addition I would like to create some control utilities but
everytime I try to pass an instance of a control I get a type mismatch
because the control is NULL.

Thanks,
Dan



Chip Pearson

WinAPI Functions
 
Dan,

I don't believe it is possible to send messages to controls on a
userform because these are windowless controls and don't have an
hWnd property.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"solex" wrote in message
...
Is it possible to use WinAPI functions such as SendMessage. I

would like to
use this API for searching for items in a listbox but cannot

find the HWND
property. In addition I would like to create some control

utilities but
everytime I try to pass an instance of a control I get a type

mismatch
because the control is NULL.

Thanks,
Dan





solex

WinAPI Functions
 
Chip,

With regards to my other question how does one go about creating a control
library if you cannot pass control to and from routines.

Thanks,
Dan

"Chip Pearson" wrote in message
...
Dan,

I don't believe it is possible to send messages to controls on a
userform because these are windowless controls and don't have an
hWnd property.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"solex" wrote in message
...
Is it possible to use WinAPI functions such as SendMessage. I

would like to
use this API for searching for items in a listbox but cannot

find the HWND
property. In addition I would like to create some control

utilities but
everytime I try to pass an instance of a control I get a type

mismatch
because the control is NULL.

Thanks,
Dan







Chip Pearson

WinAPI Functions
 
Dan,

I'm not sure what your second question is, but you can certainly
pass a control reference to procedures. For example,

Sub DoSomething(CBX As MSForms.ComboBox)
' do something ith CBX
End Sub

You can then call this with code like

DoSomething CBX:=Me.ComboBox1


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"solex" wrote in message
...
Chip,

With regards to my other question how does one go about

creating a control
library if you cannot pass control to and from routines.

Thanks,
Dan

"Chip Pearson" wrote in message
...
Dan,

I don't believe it is possible to send messages to controls

on a
userform because these are windowless controls and don't have

an
hWnd property.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"solex" wrote in message
...
Is it possible to use WinAPI functions such as SendMessage.

I
would like to
use this API for searching for items in a listbox but

cannot
find the HWND
property. In addition I would like to create some control

utilities but
everytime I try to pass an instance of a control I get a

type
mismatch
because the control is NULL.

Thanks,
Dan









mct

WinAPI Functions
 
So this is also why I'm pulling my hairs out on the question how to add an
icon to a UserForm?

hans

"Chip Pearson" schreef in bericht
...
Dan,

I don't believe it is possible to send messages to controls on a
userform because these are windowless controls and don't have an
hWnd property.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"solex" wrote in message
...
Is it possible to use WinAPI functions such as SendMessage. I

would like to
use this API for searching for items in a listbox but cannot

find the HWND
property. In addition I would like to create some control

utilities but
everytime I try to pass an instance of a control I get a type

mismatch
because the control is NULL.

Thanks,
Dan








All times are GMT +1. The time now is 06:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com