Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

using JNI

  Asked By: Hisham    Date: Jun 13    Category: Java    Views: 696
  

i know that pure java can't disable alt+tab,i must use JNI with C
language. i have a pile of codes to disable the alt+tab in C but i do
not know how to do it in JNI...i have looked at the tutorial in
java.sun,but i do not understand how it works.can anyone help?thanks
in advance...

these are my codes in C:

Private Declare Function SystemParametersInfo Lib "user32" _
Alias "SystemParametersInfoA" (ByVal uAction As Long, _
ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As
Long

Private Const SPI_SCREENSAVERRUNNING = 97

Dim ret As Integer
Dim pOld As Boolean

Private Sub Form_Load()
'The line below calls the function and passes
'the constant and TRUE to fool Windows into thinking
'the screensaver is running and FALSE to do the opposite...


ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0)

End Sub

Private Sub Form_Unload(Cancel As Integer)
'NOTE: THIS MUST BE SET TO FALSE WHEN
'THE FORM OR APP CLOSES
'If you do not set it to false, these keys will not work
'with any app, or with anything in the Windows Environment...

ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)

End Sub

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Kiet Jainukul     Answered On: Jun 13

That looks more like VB to me. I don't think yuo can
use VB with JNI.

 
Answer #2    Answered By: Hooriya Khan     Answered On: Jun 13

i have another pile of codes,i guess its in c++.i need to disable
alt+tab as i had mention earlier in my message.since these codes  are
in c++,that means i can't compile it using jdk right?how should i
compile it then?

 
Didn't find what you were looking for? Find more on using JNI Or get search suggestion and latest updates.




Tagged: