어부지망생
어부지망생
CC#
Created by 어부지망생 on 7/10/2023 in #help
❔ Capture screen(video codec) and send to client simultaneously using socket
anyone knows please mention me thanks for supporting
7 replies
CC#
Created by 어부지망생 on 7/10/2023 in #help
❔ Capture screen(video codec) and send to client simultaneously using socket
client is java (android)
7 replies
CC#
Created by 어부지망생 on 7/10/2023 in #help
❔ Capture screen(video codec) and send to client simultaneously using socket
private class ReceiveDataTask extends AsyncTask<Void, Void, Bitmap> {

@Override
protected Bitmap doInBackground(Void... voids) {
try {
// Establish a TCP connection with the server
Socket socket = new Socket();
socket.connect(new InetSocketAddress(ip, 50523), 500);

while (screen_running) {
// Receive the screen image data
InputStream inputStream = socket.getInputStream();
BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);

// Decode the image data into a Bitmap
Bitmap bitmap = BitmapFactory.decodeStream(bufferedInputStream);

// Update the ImageView on the UI thread
runOnUiThread(new Runnable() {
@Override
public void run() {
if (bitmap != null)
{
control_screen_computer_screen.setImageBitmap(bitmap);
Log.wtf("receive data task", "image changed");
}

else
{
Log.wtf("receive data task", "image data null");
}

}
});

Thread.sleep(20);
}

// Close the connection
socket.close();
}

catch (Exception e)
{
Log.wtf("receive data task", "error occur " + e);
}
return null;
}
}
private class ReceiveDataTask extends AsyncTask<Void, Void, Bitmap> {

@Override
protected Bitmap doInBackground(Void... voids) {
try {
// Establish a TCP connection with the server
Socket socket = new Socket();
socket.connect(new InetSocketAddress(ip, 50523), 500);

while (screen_running) {
// Receive the screen image data
InputStream inputStream = socket.getInputStream();
BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);

// Decode the image data into a Bitmap
Bitmap bitmap = BitmapFactory.decodeStream(bufferedInputStream);

// Update the ImageView on the UI thread
runOnUiThread(new Runnable() {
@Override
public void run() {
if (bitmap != null)
{
control_screen_computer_screen.setImageBitmap(bitmap);
Log.wtf("receive data task", "image changed");
}

else
{
Log.wtf("receive data task", "image data null");
}

}
});

Thread.sleep(20);
}

// Close the connection
socket.close();
}

catch (Exception e)
{
Log.wtf("receive data task", "error occur " + e);
}
return null;
}
}
7 replies
CC#
Created by 어부지망생 on 7/10/2023 in #help
❔ Capture screen(video codec) and send to client simultaneously using socket
Client:
7 replies
CC#
Created by 어부지망생 on 7/10/2023 in #help
❔ Capture screen(video codec) and send to client simultaneously using socket

private Bitmap CaptureScreen()
{
// Capture the screen using the GDI API
Rectangle screenBounds = System.Windows.Forms.Screen.PrimaryScreen.Bounds;
Bitmap bitmap = new Bitmap(screenBounds.Width, screenBounds.Height, PixelFormat.Format32bppArgb);
using (Graphics graphics = Graphics.FromImage(bitmap))
{
graphics.CopyFromScreen(screenBounds.Left, screenBounds.Top, 0, 0, screenBounds.Size, CopyPixelOperation.SourceCopy);
}

return bitmap;
}

private byte[] ImageToByteArray(Image image)
{
using (MemoryStream ms = new MemoryStream())
{
image.Save(ms, ImageFormat.Jpeg);
return ms.ToArray();
}
}

private Bitmap CaptureScreen()
{
// Capture the screen using the GDI API
Rectangle screenBounds = System.Windows.Forms.Screen.PrimaryScreen.Bounds;
Bitmap bitmap = new Bitmap(screenBounds.Width, screenBounds.Height, PixelFormat.Format32bppArgb);
using (Graphics graphics = Graphics.FromImage(bitmap))
{
graphics.CopyFromScreen(screenBounds.Left, screenBounds.Top, 0, 0, screenBounds.Size, CopyPixelOperation.SourceCopy);
}

return bitmap;
}

private byte[] ImageToByteArray(Image image)
{
using (MemoryStream ms = new MemoryStream())
{
image.Save(ms, ImageFormat.Jpeg);
return ms.ToArray();
}
}
7 replies
CC#
Created by 어부지망생 on 4/15/2023 in #help
❔ execute winform application by using windows service
Ah ok 😦
21 replies
CC#
Created by 어부지망생 on 4/15/2023 in #help
❔ execute winform application by using windows service
Can u explain me how to doit?
21 replies
CC#
Created by 어부지망생 on 4/15/2023 in #help
❔ execute winform application by using windows service
@jcotton42 is it possible?
21 replies
CC#
Created by 어부지망생 on 4/15/2023 in #help
❔ execute winform application by using windows service
And thanks for helping me both of you 🙂
21 replies
CC#
Created by 어부지망생 on 4/15/2023 in #help
❔ execute winform application by using windows service
Em.. actually i want to execute ui in service like teamviewer..
21 replies
CC#
Created by 어부지망생 on 4/15/2023 in #help
❔ execute winform application by using windows service
it executes process but i can't see ui
21 replies
CC#
Created by 어부지망생 on 4/15/2023 in #help
❔ execute winform application by using windows service
i have already tried them but it doesn't work
21 replies
CC#
Created by 어부지망생 on 3/25/2023 in #help
❔ keyboard input not working in windows service
error code 5
6 replies
CC#
Created by 어부지망생 on 3/25/2023 in #help
❔ keyboard input not working in windows service
keybd_event(VK_MEDIA_PLAY_PAUSE, 0, KEYEVENTF_EXTENTEDKEY, IntPtr.Zero); // Play/Pause
keybd_event(VK_MEDIA_PLAY_PAUSE, 0, KEYEVENTF_EXTENTEDKEY, IntPtr.Zero); // Play/Pause
6 replies
CC#
Created by 어부지망생 on 3/25/2023 in #help
❔ keyboard input not working in windows service
public const int KEYEVENTF_EXTENTEDKEY = 1;
public const int KEYEVENTF_KEYUP = 0;
public const int VK_MEDIA_NEXT_TRACK = 0xB0;
public const int VK_MEDIA_PLAY_PAUSE = 0xB3;
public const int VK_MEDIA_PREV_TRACK = 0xB1;

[DllImport("user32.dll")]
public static extern void keybd_event(byte virtualKey, byte scanCode, uint flags, IntPtr extraInfo);
public const int KEYEVENTF_EXTENTEDKEY = 1;
public const int KEYEVENTF_KEYUP = 0;
public const int VK_MEDIA_NEXT_TRACK = 0xB0;
public const int VK_MEDIA_PLAY_PAUSE = 0xB3;
public const int VK_MEDIA_PREV_TRACK = 0xB1;

[DllImport("user32.dll")]
public static extern void keybd_event(byte virtualKey, byte scanCode, uint flags, IntPtr extraInfo);
6 replies
CC#
Created by 어부지망생 on 3/1/2023 in #help
❔ Allow service to interact with desktop
I meam service running in background
87 replies
CC#
Created by 어부지망생 on 3/1/2023 in #help
❔ Allow service to interact with desktop
Nono i want to control media like play pause music
87 replies
CC#
Created by 어부지망생 on 3/1/2023 in #help
❔ Allow service to interact with desktop
Ah... what should i do...
87 replies
CC#
Created by 어부지망생 on 3/1/2023 in #help
❔ Allow service to interact with desktop
Like softwafe developer?
87 replies
CC#
Created by 어부지망생 on 3/1/2023 in #help
❔ Allow service to interact with desktop
And just wondering are u working on it industry?
87 replies